pub struct Swap {
pub id: <PoolId as SolType>::RustType,
pub sender: Address,
pub amount0: i128,
pub amount1: i128,
pub sqrtPriceX96: U160,
pub liquidity: u128,
pub tick: I24,
pub fee: U24,
}
Expand description
@notice Emitted for swaps between currency0 and currency1
@param id The abi encoded hash of the pool key struct for the pool that was modified
@param sender The address that initiated the swap call, and that received the callback
@param amount0 The delta of the currency0 balance of the pool
@param amount1 The delta of the currency1 balance of the pool
@param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
@param liquidity The liquidity of the pool after the swap
@param tick The log base 1.0001 of the price of the pool after the swap
Event with signature Swap(bytes32,address,int128,int128,uint160,uint128,int24,uint24)
and selector 0x40e9cecb9f5f1f1c5b9c97dec2917b7ee92e57ba5563708daca94dd84ad7112f
.
event Swap(PoolId indexed id, address indexed sender, int128 amount0, int128 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint24 fee);
Fields§
§id: <PoolId as SolType>::RustType
§sender: Address
§amount0: i128
§amount1: i128
§sqrtPriceX96: U160
§liquidity: u128
§tick: I24
§fee: U24
Trait Implementations§
Source§impl IntoLogData for Swap
impl IntoLogData for Swap
Source§fn to_log_data(&self) -> LogData
fn to_log_data(&self) -> LogData
LogData
] object.Source§fn into_log_data(self) -> LogData
fn into_log_data(self) -> LogData
LogData
] object.Source§impl SolEvent for Swap
impl SolEvent for Swap
Source§const SIGNATURE: &'static str = "Swap(bytes32,address,int128,int128,uint160,uint128,int24,uint24)"
const SIGNATURE: &'static str = "Swap(bytes32,address,int128,int128,uint160,uint128,int24,uint24)"
Source§const SIGNATURE_HASH: B256 = _
const SIGNATURE_HASH: B256 = _
keccak256(SIGNATURE)
Read moreSource§type DataTuple<'a> = (Int<128>, Int<128>, Uint<160>, Uint<128>, Int<24>, Uint<24>)
type DataTuple<'a> = (Int<128>, Int<128>, Uint<160>, Uint<128>, Int<24>, Uint<24>)
Source§type DataToken<'a> = <<Swap as SolEvent>::DataTuple<'a> as SolType>::Token<'a>
type DataToken<'a> = <<Swap as SolEvent>::DataTuple<'a> as SolType>::Token<'a>
TokenSeq
] type corresponding to the tuple.Source§type TopicList = (FixedBytes<32>, PoolId, Address)
type TopicList = (FixedBytes<32>, PoolId, Address)
Source§fn new(
topics: <Self::TopicList as SolType>::RustType,
data: <Self::DataTuple<'_> as SolType>::RustType,
) -> Self
fn new( topics: <Self::TopicList as SolType>::RustType, data: <Self::DataTuple<'_> as SolType>::RustType, ) -> Self
Source§fn check_signature(
topics: &<Self::TopicList as SolType>::RustType,
) -> Result<()>
fn check_signature( topics: &<Self::TopicList as SolType>::RustType, ) -> Result<()>
Source§fn tokenize_body(&self) -> Self::DataToken<'_>
fn tokenize_body(&self) -> Self::DataToken<'_>
Source§fn encode_topics_raw(&self, out: &mut [WordToken]) -> Result<()>
fn encode_topics_raw(&self, out: &mut [WordToken]) -> Result<()>
§fn new_checked(
topics: <Self::TopicList as SolType>::RustType,
data: <Self::DataTuple<'_> as SolType>::RustType,
) -> Result<Self, Error>
fn new_checked( topics: <Self::TopicList as SolType>::RustType, data: <Self::DataTuple<'_> as SolType>::RustType, ) -> Result<Self, Error>
§fn abi_encoded_size(&self) -> usize
fn abi_encoded_size(&self) -> usize
§fn encode_data_to(&self, out: &mut Vec<u8>)
fn encode_data_to(&self, out: &mut Vec<u8>)
§fn encode_data(&self) -> Vec<u8> ⓘ
fn encode_data(&self) -> Vec<u8> ⓘ
§fn encode_topics(&self) -> Vec<WordToken>
fn encode_topics(&self) -> Vec<WordToken>
§fn encode_topics_array<const LEN: usize>(&self) -> [WordToken; LEN]
fn encode_topics_array<const LEN: usize>(&self) -> [WordToken; LEN]
§fn encode_log_data(&self) -> LogData
fn encode_log_data(&self) -> LogData
LogData
].§fn encode_log(log: &Log<Self>) -> Log
fn encode_log(log: &Log<Self>) -> Log
Log
] containing this event into a [Log
] containing
[LogData
].§fn decode_topics<I, D>(
topics: I,
) -> Result<<Self::TopicList as SolType>::RustType, Error>where
I: IntoIterator<Item = D>,
D: Into<WordToken>,
fn decode_topics<I, D>(
topics: I,
) -> Result<<Self::TopicList as SolType>::RustType, Error>where
I: IntoIterator<Item = D>,
D: Into<WordToken>,
§fn abi_decode_data<'a>(
data: &'a [u8],
validate: bool,
) -> Result<<Self::DataTuple<'a> as SolType>::RustType, Error>
fn abi_decode_data<'a>( data: &'a [u8], validate: bool, ) -> Result<<Self::DataTuple<'a> as SolType>::RustType, Error>
§fn decode_raw_log<I, D>(
topics: I,
data: &[u8],
validate: bool,
) -> Result<Self, Error>where
I: IntoIterator<Item = D>,
D: Into<WordToken>,
fn decode_raw_log<I, D>(
topics: I,
data: &[u8],
validate: bool,
) -> Result<Self, Error>where
I: IntoIterator<Item = D>,
D: Into<WordToken>,
§fn decode_log_data(log: &LogData, validate: bool) -> Result<Self, Error>
fn decode_log_data(log: &LogData, validate: bool) -> Result<Self, Error>
§fn decode_log(log: &Log, validate: bool) -> Result<Log<Self>, Error>
fn decode_log(log: &Log, validate: bool) -> Result<Log<Self>, Error>
impl Eq for Swap
impl StructuralPartialEq for Swap
Auto Trait Implementations§
impl Freeze for Swap
impl RefUnwindSafe for Swap
impl Send for Swap
impl Sync for Swap
impl Unpin for Swap
impl UnwindSafe for Swap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 144 bytes