Files
tycho-protocol-sdk/substreams/ethereum-ambient/src/pb/tycho.ambient.v1.rs
Louise Poole ad0a391f72 chore: clean up ambient (#136)
* fix: remove unnecessary tx field in ProtocolComponent

* chore: move ambient protobuf files to ambient module

* chore: remove dependency on common message types

This allows us to isolate the ambient specific messages within the ambient module

* feat: update ambient substream with new message structs

* chore: update substream configs

And remove use of deprecated BlockContractChanges.

* feat: implement From for AmbientProtocolComponent to ProtocolComponent
2025-01-27 10:36:13 +02:00

50 lines
2.0 KiB
Rust

// @generated
/// A change to a pool's balance. Ambient specific.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmbientBalanceDelta {
/// The address of the ERC20 token whose balance changed.
#[prost(bytes="vec", tag="1")]
pub pool_hash: ::prost::alloc::vec::Vec<u8>,
/// The token type: it can be base or quote.
#[prost(string, tag="2")]
pub token_type: ::prost::alloc::string::String,
/// The delta of the token.
#[prost(bytes="vec", tag="3")]
pub token_delta: ::prost::alloc::vec::Vec<u8>,
/// Used to determine the order of the balance changes. Necessary for the balance store.
#[prost(uint64, tag="4")]
pub ordinal: u64,
/// Transaction index of the balance change
#[prost(uint64, tag="5")]
pub tx_index: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmbientProtocolComponent {
/// A unique identifier for the component within the protocol.
#[prost(string, tag="1")]
pub id: ::prost::alloc::string::String,
/// Addresses of the ERC20 tokens used by the component.
#[prost(bytes="vec", repeated, tag="2")]
pub tokens: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
/// Ambient pool index [static attribute for ambient pools]
#[prost(bytes="vec", tag="3")]
pub pool_index: ::prost::alloc::vec::Vec<u8>,
/// Transaction index for the component creation
#[prost(uint64, tag="4")]
pub tx_index: u64,
}
/// Ambient pool changes within a single block
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockPoolChanges {
/// New protocol components added in this block
#[prost(message, repeated, tag="1")]
pub new_components: ::prost::alloc::vec::Vec<AmbientProtocolComponent>,
/// Balance changes on this block
#[prost(message, repeated, tag="2")]
pub balance_deltas: ::prost::alloc::vec::Vec<AmbientBalanceDelta>,
}
// @@protoc_insertion_point(module)