Skip to content

Commit

Permalink
Update proto definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpapercut committed Jul 10, 2024
1 parent 8739ed7 commit 7c7a64e
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 73 deletions.
74 changes: 40 additions & 34 deletions proto/raydium.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,53 @@ message RaydiumTransactionEvents {
}

message RaydiumEvent {
string amm = 1;
string user = 2;
oneof data {
InitializeData initialize = 3;
DepositData deposit = 4;
WithdrawData withdraw = 5;
SwapData swap = 6;
oneof event {
InitializeEvent initialize = 1;
DepositEvent deposit = 2;
WithdrawEvent withdraw = 3;
SwapEvent swap = 4;
}
}

message InitializeData {
uint64 pcInitAmount = 1;
uint64 coinInitAmount = 2;
uint64 lpInitAmount = 3;
string pcMint = 4;
string coinMint = 5;
string lpMint = 6;
uint32 nonce = 7;
message InitializeEvent {
string amm = 1;
string user = 2;
uint64 pcInitAmount = 3;
uint64 coinInitAmount = 4;
uint64 lpInitAmount = 5;
string pcMint = 6;
string coinMint = 7;
string lpMint = 8;
uint32 nonce = 9;
}

message DepositData {
uint64 pcAmount = 1;
uint64 coinAmount = 2;
uint64 lpAmount = 3;
string pcMint = 4;
string coinMint = 5;
string lpMint = 6;
message DepositEvent {
string amm = 1;
string user = 2;
uint64 pcAmount = 3;
uint64 coinAmount = 4;
uint64 lpAmount = 5;
string pcMint = 6;
string coinMint = 7;
string lpMint = 8;
}

message WithdrawData {
uint64 pcAmount = 1;
uint64 coinAmount = 2;
uint64 lpAmount = 3;
string pcMint = 4;
string coinMint = 5;
string lpMint = 6;
message WithdrawEvent {
string amm = 1;
string user = 2;
uint64 pcAmount = 3;
uint64 coinAmount = 4;
uint64 lpAmount = 5;
string pcMint = 6;
string coinMint = 7;
string lpMint = 8;
}

message SwapData {
string mintIn = 1;
string mintOut = 2;
uint64 amountIn = 3;
uint64 amountOut = 4;
message SwapEvent {
string amm = 1;
string user = 2;
string mintIn = 3;
string mintOut = 4;
uint64 amountIn = 5;
uint64 amountOut = 6;
}
90 changes: 51 additions & 39 deletions src/pb/raydium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,88 +16,100 @@ pub struct RaydiumTransactionEvents {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RaydiumEvent {
#[prost(string, tag="1")]
pub amm: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub user: ::prost::alloc::string::String,
#[prost(oneof="raydium_event::Data", tags="3, 4, 5, 6")]
pub data: ::core::option::Option<raydium_event::Data>,
#[prost(oneof="raydium_event::Event", tags="1, 2, 3, 4")]
pub event: ::core::option::Option<raydium_event::Event>,
}
/// Nested message and enum types in `RaydiumEvent`.
pub mod raydium_event {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Data {
pub enum Event {
#[prost(message, tag="1")]
Initialize(super::InitializeEvent),
#[prost(message, tag="2")]
Deposit(super::DepositEvent),
#[prost(message, tag="3")]
Initialize(super::InitializeData),
Withdraw(super::WithdrawEvent),
#[prost(message, tag="4")]
Deposit(super::DepositData),
#[prost(message, tag="5")]
Withdraw(super::WithdrawData),
#[prost(message, tag="6")]
Swap(super::SwapData),
Swap(super::SwapEvent),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitializeData {
#[prost(uint64, tag="1")]
pub struct InitializeEvent {
#[prost(string, tag="1")]
pub amm: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub user: ::prost::alloc::string::String,
#[prost(uint64, tag="3")]
pub pc_init_amount: u64,
#[prost(uint64, tag="2")]
#[prost(uint64, tag="4")]
pub coin_init_amount: u64,
#[prost(uint64, tag="3")]
#[prost(uint64, tag="5")]
pub lp_init_amount: u64,
#[prost(string, tag="4")]
#[prost(string, tag="6")]
pub pc_mint: ::prost::alloc::string::String,
#[prost(string, tag="5")]
#[prost(string, tag="7")]
pub coin_mint: ::prost::alloc::string::String,
#[prost(string, tag="6")]
#[prost(string, tag="8")]
pub lp_mint: ::prost::alloc::string::String,
#[prost(uint32, tag="7")]
#[prost(uint32, tag="9")]
pub nonce: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DepositData {
#[prost(uint64, tag="1")]
pub struct DepositEvent {
#[prost(string, tag="1")]
pub amm: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub user: ::prost::alloc::string::String,
#[prost(uint64, tag="3")]
pub pc_amount: u64,
#[prost(uint64, tag="2")]
#[prost(uint64, tag="4")]
pub coin_amount: u64,
#[prost(uint64, tag="3")]
#[prost(uint64, tag="5")]
pub lp_amount: u64,
#[prost(string, tag="4")]
#[prost(string, tag="6")]
pub pc_mint: ::prost::alloc::string::String,
#[prost(string, tag="5")]
#[prost(string, tag="7")]
pub coin_mint: ::prost::alloc::string::String,
#[prost(string, tag="6")]
#[prost(string, tag="8")]
pub lp_mint: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WithdrawData {
#[prost(uint64, tag="1")]
pub struct WithdrawEvent {
#[prost(string, tag="1")]
pub amm: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub user: ::prost::alloc::string::String,
#[prost(uint64, tag="3")]
pub pc_amount: u64,
#[prost(uint64, tag="2")]
#[prost(uint64, tag="4")]
pub coin_amount: u64,
#[prost(uint64, tag="3")]
#[prost(uint64, tag="5")]
pub lp_amount: u64,
#[prost(string, tag="4")]
#[prost(string, tag="6")]
pub pc_mint: ::prost::alloc::string::String,
#[prost(string, tag="5")]
#[prost(string, tag="7")]
pub coin_mint: ::prost::alloc::string::String,
#[prost(string, tag="6")]
#[prost(string, tag="8")]
pub lp_mint: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwapData {
pub struct SwapEvent {
#[prost(string, tag="1")]
pub mint_in: ::prost::alloc::string::String,
pub amm: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub user: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub mint_in: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub mint_out: ::prost::alloc::string::String,
#[prost(uint64, tag="3")]
#[prost(uint64, tag="5")]
pub amount_in: u64,
#[prost(uint64, tag="4")]
#[prost(uint64, tag="6")]
pub amount_out: u64,
}
// @@protoc_insertion_point(module)

0 comments on commit 7c7a64e

Please sign in to comment.