Skip to content

Commit 4450a1d

Browse files
authored
Merge branch 'main' into main
2 parents dad7126 + dde1723 commit 4450a1d

5 files changed

Lines changed: 770 additions & 35 deletions

File tree

creator-keys/src/events.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,4 +1856,30 @@ pub fn batch_transfer_completed_topics(
18561856
creator.clone(),
18571857
from.clone(),
18581858
)
1859+
/// Event name for a price-oracle read.
1860+
pub const PRICE_QUERIED_EVENT_NAME: Symbol = symbol_short!("pri_qry");
1861+
1862+
/// Stable price-queried event payload for downstream indexers.
1863+
///
1864+
/// Event shape:
1865+
/// - topics: `(PRICE_QUERIED_EVENT_NAME, caller)`
1866+
/// - data: `PriceQueriedEvent`
1867+
///
1868+
/// Emitted on every successful price-oracle read (`get_price` /
1869+
/// `get_twap_price`), carrying the calling contract's address and the returned
1870+
/// price.
1871+
#[derive(Clone, Debug, Eq, PartialEq)]
1872+
#[contracttype]
1873+
pub struct PriceQueriedEvent {
1874+
/// Contract that invoked the oracle entrypoint.
1875+
pub caller: Address,
1876+
/// Creator whose key's price was read.
1877+
pub creator: Address,
1878+
/// Price returned to the caller.
1879+
pub price: i128,
1880+
}
1881+
1882+
/// Shared price-queried event topics tuple.
1883+
pub fn price_queried_topics(caller: &Address) -> (Symbol, Address) {
1884+
(PRICE_QUERIED_EVENT_NAME, caller.clone())
18591885
}

0 commit comments

Comments
 (0)