@@ -24,6 +24,7 @@ use pyo3::prelude::*;
2424use crate :: config:: { BlockchainDataClientConfig , DexPoolFilters } ;
2525
2626#[ pymethods]
27+ #[ pyo3_stub_gen:: derive:: gen_stub_pymethods( module = "nautilus_trader.adapters.blockchain" ) ]
2728impl DexPoolFilters {
2829 /// Creates a new `DexPoolFilters` instance.
2930 #[ new]
@@ -34,13 +35,26 @@ impl DexPoolFilters {
3435}
3536
3637#[ pymethods]
38+ #[ pyo3_stub_gen:: derive:: gen_stub_pymethods( module = "nautilus_trader.adapters.blockchain" ) ]
3739impl BlockchainDataClientConfig {
3840 /// Creates a new `BlockchainDataClientConfig` instance.
3941 #[ new]
4042 #[ allow( clippy:: too_many_arguments) ]
4143 #[ pyo3( signature = ( chain, dex_ids, http_rpc_url, rpc_requests_per_second=None , multicall_calls_per_rpc_request=None , wss_rpc_url=None , use_hypersync_for_live_data=true , from_block=None , pool_filters=None , postgres_cache_database_config=None ) ) ]
4244 fn py_new (
45+ #[ gen_stub(
46+ override_type(
47+ type_repr = "nautilus_trader.model.Chain" ,
48+ imports = ( "nautilus_trader.model" , ) ,
49+ ) ,
50+ ) ]
4351 chain : & Chain ,
52+ #[ gen_stub(
53+ override_type(
54+ type_repr = "typing.Sequence[nautilus_trader.model.DexType]" ,
55+ imports = ( "typing" , "nautilus_trader.model" ) ,
56+ ) ,
57+ ) ]
4458 dex_ids : Vec < DexType > ,
4559 http_rpc_url : String ,
4660 rpc_requests_per_second : Option < u32 > ,
@@ -49,6 +63,12 @@ impl BlockchainDataClientConfig {
4963 use_hypersync_for_live_data : bool ,
5064 from_block : Option < u64 > ,
5165 pool_filters : Option < DexPoolFilters > ,
66+ #[ gen_stub(
67+ override_type(
68+ type_repr = "typing.Optional[nautilus_trader.infrastructure.PostgresConnectOptions]" ,
69+ imports = ( "typing" , "nautilus_trader.infrastructure" ) ,
70+ ) ,
71+ ) ]
5272 postgres_cache_database_config : Option < PostgresConnectOptions > ,
5373 ) -> Self {
5474 Self :: new (
@@ -67,6 +87,12 @@ impl BlockchainDataClientConfig {
6787
6888 /// Returns the chain configuration.
6989 #[ getter]
90+ #[ gen_stub(
91+ override_return_type(
92+ type_repr = "nautilus_trader.model.Chain" ,
93+ imports = ( "nautilus_trader.model" , ) ,
94+ ) ,
95+ ) ]
7096 fn chain ( & self ) -> Chain {
7197 ( * self . chain ) . clone ( )
7298 }
0 commit comments