diff --git a/buf.gen.yaml b/buf.gen.yaml index 0464ad6d..7151c257 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -24,6 +24,6 @@ inputs: # tag: v1.13.0 # subdir: proto - git_repo: https://github.com/InjectiveLabs/injective-core - branch: feat/update_chain_stream_for_exchange_v2 + branch: feat/add_exchange_v1_compatibility_to_chain_stream subdir: proto - directory: proto diff --git a/examples/chain_client/7_ChainStream.py b/examples/chain_client/7_ChainStream.py index 05a5bbdc..d63ff6ea 100644 --- a/examples/chain_client/7_ChainStream.py +++ b/examples/chain_client/7_ChainStream.py @@ -31,29 +31,29 @@ async def main() -> None: inj_usdt_market = "0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe" inj_usdt_perp_market = "0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6" - bank_balances_filter = composer.chain_stream_bank_balances_filter( + bank_balances_filter = composer.chain_stream_bank_balances_v2_filter( accounts=["inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r"] ) - subaccount_deposits_filter = composer.chain_stream_subaccount_deposits_filter(subaccount_ids=[subaccount_id]) - spot_trades_filter = composer.chain_stream_trades_filter(subaccount_ids=["*"], market_ids=[inj_usdt_market]) - derivative_trades_filter = composer.chain_stream_trades_filter( + subaccount_deposits_filter = composer.chain_stream_subaccount_deposits_v2_filter(subaccount_ids=[subaccount_id]) + spot_trades_filter = composer.chain_stream_trades_v2_filter(subaccount_ids=["*"], market_ids=[inj_usdt_market]) + derivative_trades_filter = composer.chain_stream_trades_v2_filter( subaccount_ids=["*"], market_ids=[inj_usdt_perp_market] ) - spot_orders_filter = composer.chain_stream_orders_filter( + spot_orders_filter = composer.chain_stream_orders_v2_filter( subaccount_ids=[subaccount_id], market_ids=[inj_usdt_market] ) - derivative_orders_filter = composer.chain_stream_orders_filter( + derivative_orders_filter = composer.chain_stream_orders_v2_filter( subaccount_ids=[subaccount_id], market_ids=[inj_usdt_perp_market] ) - spot_orderbooks_filter = composer.chain_stream_orderbooks_filter(market_ids=[inj_usdt_market]) - derivative_orderbooks_filter = composer.chain_stream_orderbooks_filter(market_ids=[inj_usdt_perp_market]) - positions_filter = composer.chain_stream_positions_filter( + spot_orderbooks_filter = composer.chain_stream_orderbooks_v2_filter(market_ids=[inj_usdt_market]) + derivative_orderbooks_filter = composer.chain_stream_orderbooks_v2_filter(market_ids=[inj_usdt_perp_market]) + positions_filter = composer.chain_stream_positions_v2_filter( subaccount_ids=[subaccount_id], market_ids=[inj_usdt_perp_market] ) - oracle_price_filter = composer.chain_stream_oracle_price_filter(symbols=["INJ", "USDT"]) + oracle_price_filter = composer.chain_stream_oracle_price_v2_filter(symbols=["INJ", "USDT"]) task = asyncio.get_event_loop().create_task( - client.listen_chain_stream_updates( + client.listen_chain_stream_v2_updates( callback=chain_stream_event_processor, on_end_callback=stream_closed_processor, on_status_callback=stream_error_processor, diff --git a/pyinjective/async_client.py b/pyinjective/async_client.py index 911c6474..d4be6c96 100644 --- a/pyinjective/async_client.py +++ b/pyinjective/async_client.py @@ -56,6 +56,7 @@ tendermint_pb2 as ibc_tendermint, ) from pyinjective.proto.injective.stream.v1beta1 import query_pb2 as chain_stream_query +from pyinjective.proto.injective.stream.v2 import query_pb2 as chain_stream_v2_query from pyinjective.proto.injective.types.v1beta1 import account_pb2 from pyinjective.utils.logger import LoggerProvider @@ -2481,6 +2482,11 @@ async def listen_chain_stream_updates( positions_filter: Optional[chain_stream_query.PositionsFilter] = None, oracle_price_filter: Optional[chain_stream_query.OraclePriceFilter] = None, ): + """ + This method is deprecated and will be removed soon. Please use `listen_chain_stream_v2_updates` instead + """ + warn("This method is deprecated. Use listen_chain_stream_v2_updates instead", DeprecationWarning, stacklevel=2) + return await self.chain_stream_api.stream( callback=callback, on_end_callback=on_end_callback, @@ -2497,6 +2503,38 @@ async def listen_chain_stream_updates( oracle_price_filter=oracle_price_filter, ) + async def listen_chain_stream_v2_updates( + self, + callback: Callable, + on_end_callback: Optional[Callable] = None, + on_status_callback: Optional[Callable] = None, + bank_balances_filter: Optional[chain_stream_v2_query.BankBalancesFilter] = None, + subaccount_deposits_filter: Optional[chain_stream_v2_query.SubaccountDepositsFilter] = None, + spot_trades_filter: Optional[chain_stream_v2_query.TradesFilter] = None, + derivative_trades_filter: Optional[chain_stream_v2_query.TradesFilter] = None, + spot_orders_filter: Optional[chain_stream_v2_query.OrdersFilter] = None, + derivative_orders_filter: Optional[chain_stream_v2_query.OrdersFilter] = None, + spot_orderbooks_filter: Optional[chain_stream_v2_query.OrderbookFilter] = None, + derivative_orderbooks_filter: Optional[chain_stream_v2_query.OrderbookFilter] = None, + positions_filter: Optional[chain_stream_v2_query.PositionsFilter] = None, + oracle_price_filter: Optional[chain_stream_v2_query.OraclePriceFilter] = None, + ): + return await self.chain_stream_api.stream_v2( + callback=callback, + on_end_callback=on_end_callback, + on_status_callback=on_status_callback, + bank_balances_filter=bank_balances_filter, + subaccount_deposits_filter=subaccount_deposits_filter, + spot_trades_filter=spot_trades_filter, + derivative_trades_filter=derivative_trades_filter, + spot_orders_filter=spot_orders_filter, + derivative_orders_filter=derivative_orders_filter, + spot_orderbooks_filter=spot_orderbooks_filter, + derivative_orderbooks_filter=derivative_orderbooks_filter, + positions_filter=positions_filter, + oracle_price_filter=oracle_price_filter, + ) + # region IBC Transfer module async def fetch_denom_trace(self, hash: str) -> Dict[str, Any]: return await self.ibc_transfer_api.fetch_denom_trace(hash=hash) diff --git a/pyinjective/client/chain/grpc_stream/chain_grpc_chain_stream.py b/pyinjective/client/chain/grpc_stream/chain_grpc_chain_stream.py index 3b34ae4d..4f86599a 100644 --- a/pyinjective/client/chain/grpc_stream/chain_grpc_chain_stream.py +++ b/pyinjective/client/chain/grpc_stream/chain_grpc_chain_stream.py @@ -4,12 +4,17 @@ from pyinjective.core.network import CookieAssistant from pyinjective.proto.injective.stream.v1beta1 import query_pb2 as chain_stream_pb, query_pb2_grpc as chain_stream_grpc +from pyinjective.proto.injective.stream.v2 import ( + query_pb2 as chain_stream_v2_pb, + query_pb2_grpc as chain_stream_v2_grpc, +) from pyinjective.utils.grpc_api_stream_assistant import GrpcApiStreamAssistant class ChainGrpcChainStream: def __init__(self, channel: Channel, cookie_assistant: CookieAssistant): self._stub = chain_stream_grpc.StreamStub(channel) + self._stub_v2 = chain_stream_v2_grpc.StreamStub(channel) self._assistant = GrpcApiStreamAssistant(cookie_assistant=cookie_assistant) async def stream( @@ -48,3 +53,40 @@ async def stream( on_end_callback=on_end_callback, on_status_callback=on_status_callback, ) + + async def stream_v2( + self, + callback: Callable, + on_end_callback: Optional[Callable] = None, + on_status_callback: Optional[Callable] = None, + bank_balances_filter: Optional[chain_stream_v2_pb.BankBalancesFilter] = None, + subaccount_deposits_filter: Optional[chain_stream_v2_pb.SubaccountDepositsFilter] = None, + spot_trades_filter: Optional[chain_stream_v2_pb.TradesFilter] = None, + derivative_trades_filter: Optional[chain_stream_v2_pb.TradesFilter] = None, + spot_orders_filter: Optional[chain_stream_v2_pb.OrdersFilter] = None, + derivative_orders_filter: Optional[chain_stream_v2_pb.OrdersFilter] = None, + spot_orderbooks_filter: Optional[chain_stream_v2_pb.OrderbookFilter] = None, + derivative_orderbooks_filter: Optional[chain_stream_v2_pb.OrderbookFilter] = None, + positions_filter: Optional[chain_stream_v2_pb.PositionsFilter] = None, + oracle_price_filter: Optional[chain_stream_v2_pb.OraclePriceFilter] = None, + ): + request = chain_stream_v2_pb.StreamRequest( + bank_balances_filter=bank_balances_filter, + subaccount_deposits_filter=subaccount_deposits_filter, + spot_trades_filter=spot_trades_filter, + derivative_trades_filter=derivative_trades_filter, + spot_orders_filter=spot_orders_filter, + derivative_orders_filter=derivative_orders_filter, + spot_orderbooks_filter=spot_orderbooks_filter, + derivative_orderbooks_filter=derivative_orderbooks_filter, + positions_filter=positions_filter, + oracle_price_filter=oracle_price_filter, + ) + + await self._assistant.listen_stream( + call=self._stub_v2.StreamV2, + request=request, + callback=callback, + on_end_callback=on_end_callback, + on_status_callback=on_status_callback, + ) diff --git a/pyinjective/composer.py b/pyinjective/composer.py index 839052cd..64c9251c 100644 --- a/pyinjective/composer.py +++ b/pyinjective/composer.py @@ -46,6 +46,7 @@ tx_pb2 as injective_permissions_tx_pb, ) from pyinjective.proto.injective.stream.v1beta1 import query_pb2 as chain_stream_query +from pyinjective.proto.injective.stream.v2 import query_pb2 as chain_stream_v2_query from pyinjective.proto.injective.tokenfactory.v1beta1 import tx_pb2 as token_factory_tx_pb from pyinjective.proto.injective.wasmx.v1 import tx_pb2 as wasmx_tx_pb from pyinjective.utils.denom import Denom @@ -2703,6 +2704,14 @@ def MsgVote( def chain_stream_bank_balances_filter( self, accounts: Optional[List[str]] = None ) -> chain_stream_query.BankBalancesFilter: + """ + This method is deprecated and will be removed soon. Please use `chain_stream_bank_balances_v2_filter` instead + """ + warn( + "This method is deprecated. Use chain_stream_bank_balances_v2_filter instead", + DeprecationWarning, + stacklevel=2, + ) accounts = accounts or ["*"] return chain_stream_query.BankBalancesFilter(accounts=accounts) @@ -2710,6 +2719,15 @@ def chain_stream_subaccount_deposits_filter( self, subaccount_ids: Optional[List[str]] = None, ) -> chain_stream_query.SubaccountDepositsFilter: + """ + This method is deprecated and will be removed soon. + Please use `chain_stream_subaccount_deposits_v2_filter` instead + """ + warn( + "This method is deprecated. Use chain_stream_subaccount_deposits_v2_filter instead", + DeprecationWarning, + stacklevel=2, + ) subaccount_ids = subaccount_ids or ["*"] return chain_stream_query.SubaccountDepositsFilter(subaccount_ids=subaccount_ids) @@ -2718,6 +2736,11 @@ def chain_stream_trades_filter( subaccount_ids: Optional[List[str]] = None, market_ids: Optional[List[str]] = None, ) -> chain_stream_query.TradesFilter: + """ + This method is deprecated and will be removed soon. Please use `chain_stream_trades_v2_filter` instead + """ + warn("This method is deprecated. Use chain_stream_trades_v2_filter instead", DeprecationWarning, stacklevel=2) + subaccount_ids = subaccount_ids or ["*"] market_ids = market_ids or ["*"] return chain_stream_query.TradesFilter(subaccount_ids=subaccount_ids, market_ids=market_ids) @@ -2727,6 +2750,11 @@ def chain_stream_orders_filter( subaccount_ids: Optional[List[str]] = None, market_ids: Optional[List[str]] = None, ) -> chain_stream_query.OrdersFilter: + """ + This method is deprecated and will be removed soon. Please use `chain_stream_orders_v2_filter` instead + """ + warn("This method is deprecated. Use chain_stream_orders_v2_filter instead", DeprecationWarning, stacklevel=2) + subaccount_ids = subaccount_ids or ["*"] market_ids = market_ids or ["*"] return chain_stream_query.OrdersFilter(subaccount_ids=subaccount_ids, market_ids=market_ids) @@ -2735,6 +2763,13 @@ def chain_stream_orderbooks_filter( self, market_ids: Optional[List[str]] = None, ) -> chain_stream_query.OrderbookFilter: + """ + This method is deprecated and will be removed soon. Please use `chain_stream_orderbooks_v2_filter` instead + """ + warn( + "This method is deprecated. Use chain_stream_orderbooks_v2_filter instead", DeprecationWarning, stacklevel=2 + ) + market_ids = market_ids or ["*"] return chain_stream_query.OrderbookFilter(market_ids=market_ids) @@ -2743,6 +2778,13 @@ def chain_stream_positions_filter( subaccount_ids: Optional[List[str]] = None, market_ids: Optional[List[str]] = None, ) -> chain_stream_query.PositionsFilter: + """ + This method is deprecated and will be removed soon. Please use `chain_stream_positions_v2_filter` instead + """ + warn( + "This method is deprecated. Use chain_stream_positions_v2_filter instead", DeprecationWarning, stacklevel=2 + ) + subaccount_ids = subaccount_ids or ["*"] market_ids = market_ids or ["*"] return chain_stream_query.PositionsFilter(subaccount_ids=subaccount_ids, market_ids=market_ids) @@ -2751,9 +2793,72 @@ def chain_stream_oracle_price_filter( self, symbols: Optional[List[str]] = None, ) -> chain_stream_query.PositionsFilter: + """ + This method is deprecated and will be removed soon. Please use `chain_stream_oracle_price_v2_filter` instead + """ + warn( + "This method is deprecated. Use chain_stream_oracle_price_v2_filter instead", + DeprecationWarning, + stacklevel=2, + ) + symbols = symbols or ["*"] return chain_stream_query.OraclePriceFilter(symbol=symbols) + def chain_stream_bank_balances_v2_filter( + self, accounts: Optional[List[str]] = None + ) -> chain_stream_v2_query.BankBalancesFilter: + accounts = accounts or ["*"] + return chain_stream_v2_query.BankBalancesFilter(accounts=accounts) + + def chain_stream_subaccount_deposits_v2_filter( + self, + subaccount_ids: Optional[List[str]] = None, + ) -> chain_stream_v2_query.SubaccountDepositsFilter: + subaccount_ids = subaccount_ids or ["*"] + return chain_stream_v2_query.SubaccountDepositsFilter(subaccount_ids=subaccount_ids) + + def chain_stream_trades_v2_filter( + self, + subaccount_ids: Optional[List[str]] = None, + market_ids: Optional[List[str]] = None, + ) -> chain_stream_v2_query.TradesFilter: + subaccount_ids = subaccount_ids or ["*"] + market_ids = market_ids or ["*"] + return chain_stream_v2_query.TradesFilter(subaccount_ids=subaccount_ids, market_ids=market_ids) + + def chain_stream_orders_v2_filter( + self, + subaccount_ids: Optional[List[str]] = None, + market_ids: Optional[List[str]] = None, + ) -> chain_stream_v2_query.OrdersFilter: + subaccount_ids = subaccount_ids or ["*"] + market_ids = market_ids or ["*"] + return chain_stream_v2_query.OrdersFilter(subaccount_ids=subaccount_ids, market_ids=market_ids) + + def chain_stream_orderbooks_v2_filter( + self, + market_ids: Optional[List[str]] = None, + ) -> chain_stream_v2_query.OrderbookFilter: + market_ids = market_ids or ["*"] + return chain_stream_v2_query.OrderbookFilter(market_ids=market_ids) + + def chain_stream_positions_v2_filter( + self, + subaccount_ids: Optional[List[str]] = None, + market_ids: Optional[List[str]] = None, + ) -> chain_stream_v2_query.PositionsFilter: + subaccount_ids = subaccount_ids or ["*"] + market_ids = market_ids or ["*"] + return chain_stream_v2_query.PositionsFilter(subaccount_ids=subaccount_ids, market_ids=market_ids) + + def chain_stream_oracle_price_v2_filter( + self, + symbols: Optional[List[str]] = None, + ) -> chain_stream_v2_query.PositionsFilter: + symbols = symbols or ["*"] + return chain_stream_v2_query.OraclePriceFilter(symbol=symbols) + # endregion # ------------------------------------------------ diff --git a/pyinjective/proto/google/api/client_pb2.py b/pyinjective/proto/google/api/client_pb2.py index 5acd81af..5aeb6aad 100644 --- a/pyinjective/proto/google/api/client_pb2.py +++ b/pyinjective/proto/google/api/client_pb2.py @@ -17,7 +17,7 @@ from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17google/api/client.proto\x12\ngoogle.api\x1a\x1dgoogle/api/launch_stage.proto\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\"\xf8\x01\n\x16\x43ommonLanguageSettings\x12\x30\n\x12reference_docs_uri\x18\x01 \x01(\tB\x02\x18\x01R\x10referenceDocsUri\x12H\n\x0c\x64\x65stinations\x18\x02 \x03(\x0e\x32$.google.api.ClientLibraryDestinationR\x0c\x64\x65stinations\x12\x62\n\x1aselective_gapic_generation\x18\x03 \x01(\x0b\x32$.google.api.SelectiveGapicGenerationR\x18selectiveGapicGeneration\"\x93\x05\n\x15\x43lientLibrarySettings\x12\x18\n\x07version\x18\x01 \x01(\tR\x07version\x12:\n\x0claunch_stage\x18\x02 \x01(\x0e\x32\x17.google.api.LaunchStageR\x0blaunchStage\x12,\n\x12rest_numeric_enums\x18\x03 \x01(\x08R\x10restNumericEnums\x12=\n\rjava_settings\x18\x15 \x01(\x0b\x32\x18.google.api.JavaSettingsR\x0cjavaSettings\x12:\n\x0c\x63pp_settings\x18\x16 \x01(\x0b\x32\x17.google.api.CppSettingsR\x0b\x63ppSettings\x12:\n\x0cphp_settings\x18\x17 \x01(\x0b\x32\x17.google.api.PhpSettingsR\x0bphpSettings\x12\x43\n\x0fpython_settings\x18\x18 \x01(\x0b\x32\x1a.google.api.PythonSettingsR\x0epythonSettings\x12=\n\rnode_settings\x18\x19 \x01(\x0b\x32\x18.google.api.NodeSettingsR\x0cnodeSettings\x12\x43\n\x0f\x64otnet_settings\x18\x1a \x01(\x0b\x32\x1a.google.api.DotnetSettingsR\x0e\x64otnetSettings\x12=\n\rruby_settings\x18\x1b \x01(\x0b\x32\x18.google.api.RubySettingsR\x0crubySettings\x12\x37\n\x0bgo_settings\x18\x1c \x01(\x0b\x32\x16.google.api.GoSettingsR\ngoSettings\"\xf4\x04\n\nPublishing\x12\x43\n\x0fmethod_settings\x18\x02 \x03(\x0b\x32\x1a.google.api.MethodSettingsR\x0emethodSettings\x12\"\n\rnew_issue_uri\x18\x65 \x01(\tR\x0bnewIssueUri\x12+\n\x11\x64ocumentation_uri\x18\x66 \x01(\tR\x10\x64ocumentationUri\x12$\n\x0e\x61pi_short_name\x18g \x01(\tR\x0c\x61piShortName\x12!\n\x0cgithub_label\x18h \x01(\tR\x0bgithubLabel\x12\x34\n\x16\x63odeowner_github_teams\x18i \x03(\tR\x14\x63odeownerGithubTeams\x12$\n\x0e\x64oc_tag_prefix\x18j \x01(\tR\x0c\x64ocTagPrefix\x12I\n\x0corganization\x18k \x01(\x0e\x32%.google.api.ClientLibraryOrganizationR\x0corganization\x12L\n\x10library_settings\x18m \x03(\x0b\x32!.google.api.ClientLibrarySettingsR\x0flibrarySettings\x12I\n!proto_reference_documentation_uri\x18n \x01(\tR\x1eprotoReferenceDocumentationUri\x12G\n rest_reference_documentation_uri\x18o \x01(\tR\x1drestReferenceDocumentationUri\"\x9a\x02\n\x0cJavaSettings\x12\'\n\x0flibrary_package\x18\x01 \x01(\tR\x0elibraryPackage\x12_\n\x13service_class_names\x18\x02 \x03(\x0b\x32/.google.api.JavaSettings.ServiceClassNamesEntryR\x11serviceClassNames\x12:\n\x06\x63ommon\x18\x03 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\x1a\x44\n\x16ServiceClassNamesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"I\n\x0b\x43ppSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"I\n\x0bPhpSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"\xfd\x01\n\x0ePythonSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\x12\x64\n\x15\x65xperimental_features\x18\x02 \x01(\x0b\x32/.google.api.PythonSettings.ExperimentalFeaturesR\x14\x65xperimentalFeatures\x1aI\n\x14\x45xperimentalFeatures\x12\x31\n\x15rest_async_io_enabled\x18\x01 \x01(\x08R\x12restAsyncIoEnabled\"J\n\x0cNodeSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"\xae\x04\n\x0e\x44otnetSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\x12Z\n\x10renamed_services\x18\x02 \x03(\x0b\x32/.google.api.DotnetSettings.RenamedServicesEntryR\x0frenamedServices\x12]\n\x11renamed_resources\x18\x03 \x03(\x0b\x32\x30.google.api.DotnetSettings.RenamedResourcesEntryR\x10renamedResources\x12+\n\x11ignored_resources\x18\x04 \x03(\tR\x10ignoredResources\x12\x38\n\x18\x66orced_namespace_aliases\x18\x05 \x03(\tR\x16\x66orcedNamespaceAliases\x12\x35\n\x16handwritten_signatures\x18\x06 \x03(\tR\x15handwrittenSignatures\x1a\x42\n\x14RenamedServicesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x1a\x43\n\x15RenamedResourcesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"J\n\x0cRubySettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"H\n\nGoSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"\xc2\x03\n\x0eMethodSettings\x12\x1a\n\x08selector\x18\x01 \x01(\tR\x08selector\x12I\n\x0clong_running\x18\x02 \x01(\x0b\x32&.google.api.MethodSettings.LongRunningR\x0blongRunning\x12\x32\n\x15\x61uto_populated_fields\x18\x03 \x03(\tR\x13\x61utoPopulatedFields\x1a\x94\x02\n\x0bLongRunning\x12G\n\x12initial_poll_delay\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationR\x10initialPollDelay\x12\x32\n\x15poll_delay_multiplier\x18\x02 \x01(\x02R\x13pollDelayMultiplier\x12?\n\x0emax_poll_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationR\x0cmaxPollDelay\x12G\n\x12total_poll_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationR\x10totalPollTimeout\"4\n\x18SelectiveGapicGeneration\x12\x18\n\x07methods\x18\x01 \x03(\tR\x07methods*\xa3\x01\n\x19\x43lientLibraryOrganization\x12+\n\'CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\x10\x00\x12\t\n\x05\x43LOUD\x10\x01\x12\x07\n\x03\x41\x44S\x10\x02\x12\n\n\x06PHOTOS\x10\x03\x12\x0f\n\x0bSTREET_VIEW\x10\x04\x12\x0c\n\x08SHOPPING\x10\x05\x12\x07\n\x03GEO\x10\x06\x12\x11\n\rGENERATIVE_AI\x10\x07*g\n\x18\x43lientLibraryDestination\x12*\n&CLIENT_LIBRARY_DESTINATION_UNSPECIFIED\x10\x00\x12\n\n\x06GITHUB\x10\n\x12\x13\n\x0fPACKAGE_MANAGER\x10\x14:J\n\x10method_signature\x12\x1e.google.protobuf.MethodOptions\x18\x9b\x08 \x03(\tR\x0fmethodSignature:C\n\x0c\x64\x65\x66\x61ult_host\x12\x1f.google.protobuf.ServiceOptions\x18\x99\x08 \x01(\tR\x0b\x64\x65\x66\x61ultHost:C\n\x0coauth_scopes\x12\x1f.google.protobuf.ServiceOptions\x18\x9a\x08 \x01(\tR\x0boauthScopes:D\n\x0b\x61pi_version\x12\x1f.google.protobuf.ServiceOptions\x18\xc1\xba\xab\xfa\x01 \x01(\tR\napiVersionB\xa9\x01\n\x0e\x63om.google.apiB\x0b\x43lientProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x03GAX\xaa\x02\nGoogle.Api\xca\x02\nGoogle\\Api\xe2\x02\x16Google\\Api\\GPBMetadata\xea\x02\x0bGoogle::Apib\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17google/api/client.proto\x12\ngoogle.api\x1a\x1dgoogle/api/launch_stage.proto\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\"\xf8\x01\n\x16\x43ommonLanguageSettings\x12\x30\n\x12reference_docs_uri\x18\x01 \x01(\tB\x02\x18\x01R\x10referenceDocsUri\x12H\n\x0c\x64\x65stinations\x18\x02 \x03(\x0e\x32$.google.api.ClientLibraryDestinationR\x0c\x64\x65stinations\x12\x62\n\x1aselective_gapic_generation\x18\x03 \x01(\x0b\x32$.google.api.SelectiveGapicGenerationR\x18selectiveGapicGeneration\"\x93\x05\n\x15\x43lientLibrarySettings\x12\x18\n\x07version\x18\x01 \x01(\tR\x07version\x12:\n\x0claunch_stage\x18\x02 \x01(\x0e\x32\x17.google.api.LaunchStageR\x0blaunchStage\x12,\n\x12rest_numeric_enums\x18\x03 \x01(\x08R\x10restNumericEnums\x12=\n\rjava_settings\x18\x15 \x01(\x0b\x32\x18.google.api.JavaSettingsR\x0cjavaSettings\x12:\n\x0c\x63pp_settings\x18\x16 \x01(\x0b\x32\x17.google.api.CppSettingsR\x0b\x63ppSettings\x12:\n\x0cphp_settings\x18\x17 \x01(\x0b\x32\x17.google.api.PhpSettingsR\x0bphpSettings\x12\x43\n\x0fpython_settings\x18\x18 \x01(\x0b\x32\x1a.google.api.PythonSettingsR\x0epythonSettings\x12=\n\rnode_settings\x18\x19 \x01(\x0b\x32\x18.google.api.NodeSettingsR\x0cnodeSettings\x12\x43\n\x0f\x64otnet_settings\x18\x1a \x01(\x0b\x32\x1a.google.api.DotnetSettingsR\x0e\x64otnetSettings\x12=\n\rruby_settings\x18\x1b \x01(\x0b\x32\x18.google.api.RubySettingsR\x0crubySettings\x12\x37\n\x0bgo_settings\x18\x1c \x01(\x0b\x32\x16.google.api.GoSettingsR\ngoSettings\"\xf4\x04\n\nPublishing\x12\x43\n\x0fmethod_settings\x18\x02 \x03(\x0b\x32\x1a.google.api.MethodSettingsR\x0emethodSettings\x12\"\n\rnew_issue_uri\x18\x65 \x01(\tR\x0bnewIssueUri\x12+\n\x11\x64ocumentation_uri\x18\x66 \x01(\tR\x10\x64ocumentationUri\x12$\n\x0e\x61pi_short_name\x18g \x01(\tR\x0c\x61piShortName\x12!\n\x0cgithub_label\x18h \x01(\tR\x0bgithubLabel\x12\x34\n\x16\x63odeowner_github_teams\x18i \x03(\tR\x14\x63odeownerGithubTeams\x12$\n\x0e\x64oc_tag_prefix\x18j \x01(\tR\x0c\x64ocTagPrefix\x12I\n\x0corganization\x18k \x01(\x0e\x32%.google.api.ClientLibraryOrganizationR\x0corganization\x12L\n\x10library_settings\x18m \x03(\x0b\x32!.google.api.ClientLibrarySettingsR\x0flibrarySettings\x12I\n!proto_reference_documentation_uri\x18n \x01(\tR\x1eprotoReferenceDocumentationUri\x12G\n rest_reference_documentation_uri\x18o \x01(\tR\x1drestReferenceDocumentationUri\"\x9a\x02\n\x0cJavaSettings\x12\'\n\x0flibrary_package\x18\x01 \x01(\tR\x0elibraryPackage\x12_\n\x13service_class_names\x18\x02 \x03(\x0b\x32/.google.api.JavaSettings.ServiceClassNamesEntryR\x11serviceClassNames\x12:\n\x06\x63ommon\x18\x03 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\x1a\x44\n\x16ServiceClassNamesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"I\n\x0b\x43ppSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"I\n\x0bPhpSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"\xc5\x02\n\x0ePythonSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\x12\x64\n\x15\x65xperimental_features\x18\x02 \x01(\x0b\x32/.google.api.PythonSettings.ExperimentalFeaturesR\x14\x65xperimentalFeatures\x1a\x90\x01\n\x14\x45xperimentalFeatures\x12\x31\n\x15rest_async_io_enabled\x18\x01 \x01(\x08R\x12restAsyncIoEnabled\x12\x45\n\x1fprotobuf_pythonic_types_enabled\x18\x02 \x01(\x08R\x1cprotobufPythonicTypesEnabled\"J\n\x0cNodeSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"\xae\x04\n\x0e\x44otnetSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\x12Z\n\x10renamed_services\x18\x02 \x03(\x0b\x32/.google.api.DotnetSettings.RenamedServicesEntryR\x0frenamedServices\x12]\n\x11renamed_resources\x18\x03 \x03(\x0b\x32\x30.google.api.DotnetSettings.RenamedResourcesEntryR\x10renamedResources\x12+\n\x11ignored_resources\x18\x04 \x03(\tR\x10ignoredResources\x12\x38\n\x18\x66orced_namespace_aliases\x18\x05 \x03(\tR\x16\x66orcedNamespaceAliases\x12\x35\n\x16handwritten_signatures\x18\x06 \x03(\tR\x15handwrittenSignatures\x1a\x42\n\x14RenamedServicesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x1a\x43\n\x15RenamedResourcesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"J\n\x0cRubySettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"H\n\nGoSettings\x12:\n\x06\x63ommon\x18\x01 \x01(\x0b\x32\".google.api.CommonLanguageSettingsR\x06\x63ommon\"\xc2\x03\n\x0eMethodSettings\x12\x1a\n\x08selector\x18\x01 \x01(\tR\x08selector\x12I\n\x0clong_running\x18\x02 \x01(\x0b\x32&.google.api.MethodSettings.LongRunningR\x0blongRunning\x12\x32\n\x15\x61uto_populated_fields\x18\x03 \x03(\tR\x13\x61utoPopulatedFields\x1a\x94\x02\n\x0bLongRunning\x12G\n\x12initial_poll_delay\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationR\x10initialPollDelay\x12\x32\n\x15poll_delay_multiplier\x18\x02 \x01(\x02R\x13pollDelayMultiplier\x12?\n\x0emax_poll_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationR\x0cmaxPollDelay\x12G\n\x12total_poll_timeout\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationR\x10totalPollTimeout\"4\n\x18SelectiveGapicGeneration\x12\x18\n\x07methods\x18\x01 \x03(\tR\x07methods*\xa3\x01\n\x19\x43lientLibraryOrganization\x12+\n\'CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED\x10\x00\x12\t\n\x05\x43LOUD\x10\x01\x12\x07\n\x03\x41\x44S\x10\x02\x12\n\n\x06PHOTOS\x10\x03\x12\x0f\n\x0bSTREET_VIEW\x10\x04\x12\x0c\n\x08SHOPPING\x10\x05\x12\x07\n\x03GEO\x10\x06\x12\x11\n\rGENERATIVE_AI\x10\x07*g\n\x18\x43lientLibraryDestination\x12*\n&CLIENT_LIBRARY_DESTINATION_UNSPECIFIED\x10\x00\x12\n\n\x06GITHUB\x10\n\x12\x13\n\x0fPACKAGE_MANAGER\x10\x14:J\n\x10method_signature\x12\x1e.google.protobuf.MethodOptions\x18\x9b\x08 \x03(\tR\x0fmethodSignature:C\n\x0c\x64\x65\x66\x61ult_host\x12\x1f.google.protobuf.ServiceOptions\x18\x99\x08 \x01(\tR\x0b\x64\x65\x66\x61ultHost:C\n\x0coauth_scopes\x12\x1f.google.protobuf.ServiceOptions\x18\x9a\x08 \x01(\tR\x0boauthScopes:D\n\x0b\x61pi_version\x12\x1f.google.protobuf.ServiceOptions\x18\xc1\xba\xab\xfa\x01 \x01(\tR\napiVersionB\xa9\x01\n\x0e\x63om.google.apiB\x0b\x43lientProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x03GAX\xaa\x02\nGoogle.Api\xca\x02\nGoogle\\Api\xe2\x02\x16Google\\Api\\GPBMetadata\xea\x02\x0bGoogle::Apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -33,10 +33,10 @@ _globals['_DOTNETSETTINGS_RENAMEDSERVICESENTRY']._serialized_options = b'8\001' _globals['_DOTNETSETTINGS_RENAMEDRESOURCESENTRY']._loaded_options = None _globals['_DOTNETSETTINGS_RENAMEDRESOURCESENTRY']._serialized_options = b'8\001' - _globals['_CLIENTLIBRARYORGANIZATION']._serialized_start=3666 - _globals['_CLIENTLIBRARYORGANIZATION']._serialized_end=3829 - _globals['_CLIENTLIBRARYDESTINATION']._serialized_start=3831 - _globals['_CLIENTLIBRARYDESTINATION']._serialized_end=3934 + _globals['_CLIENTLIBRARYORGANIZATION']._serialized_start=3738 + _globals['_CLIENTLIBRARYORGANIZATION']._serialized_end=3901 + _globals['_CLIENTLIBRARYDESTINATION']._serialized_start=3903 + _globals['_CLIENTLIBRARYDESTINATION']._serialized_end=4006 _globals['_COMMONLANGUAGESETTINGS']._serialized_start=137 _globals['_COMMONLANGUAGESETTINGS']._serialized_end=385 _globals['_CLIENTLIBRARYSETTINGS']._serialized_start=388 @@ -52,25 +52,25 @@ _globals['_PHPSETTINGS']._serialized_start=2040 _globals['_PHPSETTINGS']._serialized_end=2113 _globals['_PYTHONSETTINGS']._serialized_start=2116 - _globals['_PYTHONSETTINGS']._serialized_end=2369 - _globals['_PYTHONSETTINGS_EXPERIMENTALFEATURES']._serialized_start=2296 - _globals['_PYTHONSETTINGS_EXPERIMENTALFEATURES']._serialized_end=2369 - _globals['_NODESETTINGS']._serialized_start=2371 - _globals['_NODESETTINGS']._serialized_end=2445 - _globals['_DOTNETSETTINGS']._serialized_start=2448 - _globals['_DOTNETSETTINGS']._serialized_end=3006 - _globals['_DOTNETSETTINGS_RENAMEDSERVICESENTRY']._serialized_start=2871 - _globals['_DOTNETSETTINGS_RENAMEDSERVICESENTRY']._serialized_end=2937 - _globals['_DOTNETSETTINGS_RENAMEDRESOURCESENTRY']._serialized_start=2939 - _globals['_DOTNETSETTINGS_RENAMEDRESOURCESENTRY']._serialized_end=3006 - _globals['_RUBYSETTINGS']._serialized_start=3008 - _globals['_RUBYSETTINGS']._serialized_end=3082 - _globals['_GOSETTINGS']._serialized_start=3084 - _globals['_GOSETTINGS']._serialized_end=3156 - _globals['_METHODSETTINGS']._serialized_start=3159 - _globals['_METHODSETTINGS']._serialized_end=3609 - _globals['_METHODSETTINGS_LONGRUNNING']._serialized_start=3333 - _globals['_METHODSETTINGS_LONGRUNNING']._serialized_end=3609 - _globals['_SELECTIVEGAPICGENERATION']._serialized_start=3611 - _globals['_SELECTIVEGAPICGENERATION']._serialized_end=3663 + _globals['_PYTHONSETTINGS']._serialized_end=2441 + _globals['_PYTHONSETTINGS_EXPERIMENTALFEATURES']._serialized_start=2297 + _globals['_PYTHONSETTINGS_EXPERIMENTALFEATURES']._serialized_end=2441 + _globals['_NODESETTINGS']._serialized_start=2443 + _globals['_NODESETTINGS']._serialized_end=2517 + _globals['_DOTNETSETTINGS']._serialized_start=2520 + _globals['_DOTNETSETTINGS']._serialized_end=3078 + _globals['_DOTNETSETTINGS_RENAMEDSERVICESENTRY']._serialized_start=2943 + _globals['_DOTNETSETTINGS_RENAMEDSERVICESENTRY']._serialized_end=3009 + _globals['_DOTNETSETTINGS_RENAMEDRESOURCESENTRY']._serialized_start=3011 + _globals['_DOTNETSETTINGS_RENAMEDRESOURCESENTRY']._serialized_end=3078 + _globals['_RUBYSETTINGS']._serialized_start=3080 + _globals['_RUBYSETTINGS']._serialized_end=3154 + _globals['_GOSETTINGS']._serialized_start=3156 + _globals['_GOSETTINGS']._serialized_end=3228 + _globals['_METHODSETTINGS']._serialized_start=3231 + _globals['_METHODSETTINGS']._serialized_end=3681 + _globals['_METHODSETTINGS_LONGRUNNING']._serialized_start=3405 + _globals['_METHODSETTINGS_LONGRUNNING']._serialized_end=3681 + _globals['_SELECTIVEGAPICGENERATION']._serialized_start=3683 + _globals['_SELECTIVEGAPICGENERATION']._serialized_end=3735 # @@protoc_insertion_point(module_scope) diff --git a/pyinjective/proto/google/api/httpbody_pb2.py b/pyinjective/proto/google/api/httpbody_pb2.py index 5a8b69fe..eb6c4482 100644 --- a/pyinjective/proto/google/api/httpbody_pb2.py +++ b/pyinjective/proto/google/api/httpbody_pb2.py @@ -15,14 +15,14 @@ from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19google/api/httpbody.proto\x12\ngoogle.api\x1a\x19google/protobuf/any.proto\"w\n\x08HttpBody\x12!\n\x0c\x63ontent_type\x18\x01 \x01(\tR\x0b\x63ontentType\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x34\n\nextensions\x18\x03 \x03(\x0b\x32\x14.google.protobuf.AnyR\nextensionsB\xa8\x01\n\x0e\x63om.google.apiB\rHttpbodyProtoP\x01Z;google.golang.org/genproto/googleapis/api/httpbody;httpbody\xf8\x01\x01\xa2\x02\x03GAX\xaa\x02\nGoogle.Api\xca\x02\nGoogle\\Api\xe2\x02\x16Google\\Api\\GPBMetadata\xea\x02\x0bGoogle::Apib\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19google/api/httpbody.proto\x12\ngoogle.api\x1a\x19google/protobuf/any.proto\"w\n\x08HttpBody\x12!\n\x0c\x63ontent_type\x18\x01 \x01(\tR\x0b\x63ontentType\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x34\n\nextensions\x18\x03 \x03(\x0b\x32\x14.google.protobuf.AnyR\nextensionsB\xa5\x01\n\x0e\x63om.google.apiB\rHttpbodyProtoP\x01Z;google.golang.org/genproto/googleapis/api/httpbody;httpbody\xa2\x02\x03GAX\xaa\x02\nGoogle.Api\xca\x02\nGoogle\\Api\xe2\x02\x16Google\\Api\\GPBMetadata\xea\x02\x0bGoogle::Apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google.api.httpbody_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\016com.google.apiB\rHttpbodyProtoP\001Z;google.golang.org/genproto/googleapis/api/httpbody;httpbody\370\001\001\242\002\003GAX\252\002\nGoogle.Api\312\002\nGoogle\\Api\342\002\026Google\\Api\\GPBMetadata\352\002\013Google::Api' + _globals['DESCRIPTOR']._serialized_options = b'\n\016com.google.apiB\rHttpbodyProtoP\001Z;google.golang.org/genproto/googleapis/api/httpbody;httpbody\242\002\003GAX\252\002\nGoogle.Api\312\002\nGoogle\\Api\342\002\026Google\\Api\\GPBMetadata\352\002\013Google::Api' _globals['_HTTPBODY']._serialized_start=68 _globals['_HTTPBODY']._serialized_end=187 # @@protoc_insertion_point(module_scope) diff --git a/pyinjective/proto/google/longrunning/operations_pb2.py b/pyinjective/proto/google/longrunning/operations_pb2.py index 719371ca..72a5cef3 100644 --- a/pyinjective/proto/google/longrunning/operations_pb2.py +++ b/pyinjective/proto/google/longrunning/operations_pb2.py @@ -15,13 +15,13 @@ from pyinjective.proto.google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from pyinjective.proto.google.api import client_pb2 as google_dot_api_dot_client__pb2 from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 +from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#google/longrunning/operations.proto\x12\x12google.longrunning\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\x1a google/protobuf/descriptor.proto\"\xcf\x01\n\tOperation\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x08metadata\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyR\x08metadata\x12\x12\n\x04\x64one\x18\x03 \x01(\x08R\x04\x64one\x12*\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusH\x00R\x05\x65rror\x12\x32\n\x08response\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00R\x08responseB\x08\n\x06result\")\n\x13GetOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"\x7f\n\x15ListOperationsRequest\x12\x12\n\x04name\x18\x04 \x01(\tR\x04name\x12\x16\n\x06\x66ilter\x18\x01 \x01(\tR\x06\x66ilter\x12\x1b\n\tpage_size\x18\x02 \x01(\x05R\x08pageSize\x12\x1d\n\npage_token\x18\x03 \x01(\tR\tpageToken\"\x7f\n\x16ListOperationsResponse\x12=\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.OperationR\noperations\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\",\n\x16\x43\x61ncelOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\",\n\x16\x44\x65leteOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"_\n\x14WaitOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x33\n\x07timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x07timeout\"Y\n\rOperationInfo\x12#\n\rresponse_type\x18\x01 \x01(\tR\x0cresponseType\x12#\n\rmetadata_type\x18\x02 \x01(\tR\x0cmetadataType2\xaa\x05\n\nOperations\x12\x94\x01\n\x0eListOperations\x12).google.longrunning.ListOperationsRequest\x1a*.google.longrunning.ListOperationsResponse\"+\xda\x41\x0bname,filter\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=operations}\x12\x7f\n\x0cGetOperation\x12\'.google.longrunning.GetOperationRequest\x1a\x1d.google.longrunning.Operation\"\'\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=operations/**}\x12~\n\x0f\x44\x65leteOperation\x12*.google.longrunning.DeleteOperationRequest\x1a\x16.google.protobuf.Empty\"\'\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=operations/**}\x12\x88\x01\n\x0f\x43\x61ncelOperation\x12*.google.longrunning.CancelOperationRequest\x1a\x16.google.protobuf.Empty\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$\"\x1f/v1/{name=operations/**}:cancel:\x01*\x12Z\n\rWaitOperation\x12(.google.longrunning.WaitOperationRequest\x1a\x1d.google.longrunning.Operation\"\x00\x1a\x1d\xca\x41\x1alongrunning.googleapis.com:i\n\x0eoperation_info\x12\x1e.google.protobuf.MethodOptions\x18\x99\x08 \x01(\x0b\x32!.google.longrunning.OperationInfoR\roperationInfoB\xda\x01\n\x16\x63om.google.longrunningB\x0fOperationsProtoP\x01ZCcloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb\xf8\x01\x01\xa2\x02\x03GLX\xaa\x02\x12Google.Longrunning\xca\x02\x12Google\\Longrunning\xe2\x02\x1eGoogle\\Longrunning\\GPBMetadata\xea\x02\x13Google::Longrunningb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#google/longrunning/operations.proto\x12\x12google.longrunning\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/protobuf/any.proto\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\"\xcf\x01\n\tOperation\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x08metadata\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyR\x08metadata\x12\x12\n\x04\x64one\x18\x03 \x01(\x08R\x04\x64one\x12*\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusH\x00R\x05\x65rror\x12\x32\n\x08response\x18\x05 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00R\x08responseB\x08\n\x06result\")\n\x13GetOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"\x7f\n\x15ListOperationsRequest\x12\x12\n\x04name\x18\x04 \x01(\tR\x04name\x12\x16\n\x06\x66ilter\x18\x01 \x01(\tR\x06\x66ilter\x12\x1b\n\tpage_size\x18\x02 \x01(\x05R\x08pageSize\x12\x1d\n\npage_token\x18\x03 \x01(\tR\tpageToken\"\x7f\n\x16ListOperationsResponse\x12=\n\noperations\x18\x01 \x03(\x0b\x32\x1d.google.longrunning.OperationR\noperations\x12&\n\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\",\n\x16\x43\x61ncelOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\",\n\x16\x44\x65leteOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"_\n\x14WaitOperationRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x33\n\x07timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x07timeout\"Y\n\rOperationInfo\x12#\n\rresponse_type\x18\x01 \x01(\tR\x0cresponseType\x12#\n\rmetadata_type\x18\x02 \x01(\tR\x0cmetadataType2\xaa\x05\n\nOperations\x12\x94\x01\n\x0eListOperations\x12).google.longrunning.ListOperationsRequest\x1a*.google.longrunning.ListOperationsResponse\"+\xda\x41\x0bname,filter\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=operations}\x12\x7f\n\x0cGetOperation\x12\'.google.longrunning.GetOperationRequest\x1a\x1d.google.longrunning.Operation\"\'\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=operations/**}\x12~\n\x0f\x44\x65leteOperation\x12*.google.longrunning.DeleteOperationRequest\x1a\x16.google.protobuf.Empty\"\'\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=operations/**}\x12\x88\x01\n\x0f\x43\x61ncelOperation\x12*.google.longrunning.CancelOperationRequest\x1a\x16.google.protobuf.Empty\"1\xda\x41\x04name\x82\xd3\xe4\x93\x02$\"\x1f/v1/{name=operations/**}:cancel:\x01*\x12Z\n\rWaitOperation\x12(.google.longrunning.WaitOperationRequest\x1a\x1d.google.longrunning.Operation\"\x00\x1a\x1d\xca\x41\x1alongrunning.googleapis.com:i\n\x0eoperation_info\x12\x1e.google.protobuf.MethodOptions\x18\x99\x08 \x01(\x0b\x32!.google.longrunning.OperationInfoR\roperationInfoB\xda\x01\n\x16\x63om.google.longrunningB\x0fOperationsProtoP\x01ZCcloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb\xf8\x01\x01\xa2\x02\x03GLX\xaa\x02\x12Google.Longrunning\xca\x02\x12Google\\Longrunning\xe2\x02\x1eGoogle\\Longrunning\\GPBMetadata\xea\x02\x13Google::Longrunningb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) diff --git a/pyinjective/proto/google/longrunning/operations_pb2_grpc.py b/pyinjective/proto/google/longrunning/operations_pb2_grpc.py index 533da2f8..e0b9948f 100644 --- a/pyinjective/proto/google/longrunning/operations_pb2_grpc.py +++ b/pyinjective/proto/google/longrunning/operations_pb2_grpc.py @@ -10,12 +10,12 @@ class OperationsStub(object): """Manages long-running operations with an API service. When an API method normally takes long time to complete, it can be designed - to return [Operation][google.longrunning.Operation] to the client, and the client can use this - interface to receive the real response asynchronously by polling the - operation resource, or pass the operation resource to another API (such as - Google Cloud Pub/Sub API) to receive the response. Any API service that - returns long-running operations should implement the `Operations` interface - so developers can have a consistent client experience. + to return [Operation][google.longrunning.Operation] to the client, and the + client can use this interface to receive the real response asynchronously by + polling the operation resource, or pass the operation resource to another API + (such as Pub/Sub API) to receive the response. Any API service that returns + long-running operations should implement the `Operations` interface so + developers can have a consistent client experience. """ def __init__(self, channel): @@ -55,25 +55,17 @@ class OperationsServicer(object): """Manages long-running operations with an API service. When an API method normally takes long time to complete, it can be designed - to return [Operation][google.longrunning.Operation] to the client, and the client can use this - interface to receive the real response asynchronously by polling the - operation resource, or pass the operation resource to another API (such as - Google Cloud Pub/Sub API) to receive the response. Any API service that - returns long-running operations should implement the `Operations` interface - so developers can have a consistent client experience. + to return [Operation][google.longrunning.Operation] to the client, and the + client can use this interface to receive the real response asynchronously by + polling the operation resource, or pass the operation resource to another API + (such as Pub/Sub API) to receive the response. Any API service that returns + long-running operations should implement the `Operations` interface so + developers can have a consistent client experience. """ def ListOperations(self, request, context): """Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. - - NOTE: the `name` binding allows API services to override the binding - to use different resource name schemes, such as `users/*/operations`. To - override the binding, API services can add a binding such as - `"/v1/{name=users/*}/operations"` to their service configuration. - For backwards compatibility, the default name includes the operations - collection id, however overriding users must ensure the name binding - is the parent resource, without the operations collection id. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -107,8 +99,9 @@ def CancelOperation(self, request, context): other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with - an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - corresponding to `Code.CANCELLED`. + an [Operation.error][google.longrunning.Operation.error] value with a + [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to + `Code.CANCELLED`. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') @@ -169,12 +162,12 @@ class Operations(object): """Manages long-running operations with an API service. When an API method normally takes long time to complete, it can be designed - to return [Operation][google.longrunning.Operation] to the client, and the client can use this - interface to receive the real response asynchronously by polling the - operation resource, or pass the operation resource to another API (such as - Google Cloud Pub/Sub API) to receive the response. Any API service that - returns long-running operations should implement the `Operations` interface - so developers can have a consistent client experience. + to return [Operation][google.longrunning.Operation] to the client, and the + client can use this interface to receive the real response asynchronously by + polling the operation resource, or pass the operation resource to another API + (such as Pub/Sub API) to receive the response. Any API service that returns + long-running operations should implement the `Operations` interface so + developers can have a consistent client experience. """ @staticmethod diff --git a/pyinjective/proto/injective/stream/v1beta1/query_pb2.py b/pyinjective/proto/injective/stream/v1beta1/query_pb2.py index d5f8bc56..20d2bdd5 100644 --- a/pyinjective/proto/injective/stream/v1beta1/query_pb2.py +++ b/pyinjective/proto/injective/stream/v1beta1/query_pb2.py @@ -14,12 +14,11 @@ from pyinjective.proto.cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 from pyinjective.proto.gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 -from pyinjective.proto.injective.exchange.v2 import events_pb2 as injective_dot_exchange_dot_v2_dot_events__pb2 -from pyinjective.proto.injective.exchange.v2 import exchange_pb2 as injective_dot_exchange_dot_v2_dot_exchange__pb2 -from pyinjective.proto.injective.exchange.v2 import order_pb2 as injective_dot_exchange_dot_v2_dot_order__pb2 +from pyinjective.proto.injective.exchange.v1beta1 import events_pb2 as injective_dot_exchange_dot_v1beta1_dot_events__pb2 +from pyinjective.proto.injective.exchange.v1beta1 import exchange_pb2 as injective_dot_exchange_dot_v1beta1_dot_exchange__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$injective/stream/v1beta1/query.proto\x12\x18injective.stream.v1beta1\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x14gogoproto/gogo.proto\x1a\"injective/exchange/v2/events.proto\x1a$injective/exchange/v2/exchange.proto\x1a!injective/exchange/v2/order.proto\"\x8e\x08\n\rStreamRequest\x12\x64\n\x14\x62\x61nk_balances_filter\x18\x01 \x01(\x0b\x32,.injective.stream.v1beta1.BankBalancesFilterB\x04\xc8\xde\x1f\x01R\x12\x62\x61nkBalancesFilter\x12v\n\x1asubaccount_deposits_filter\x18\x02 \x01(\x0b\x32\x32.injective.stream.v1beta1.SubaccountDepositsFilterB\x04\xc8\xde\x1f\x01R\x18subaccountDepositsFilter\x12Z\n\x12spot_trades_filter\x18\x03 \x01(\x0b\x32&.injective.stream.v1beta1.TradesFilterB\x04\xc8\xde\x1f\x01R\x10spotTradesFilter\x12\x66\n\x18\x64\x65rivative_trades_filter\x18\x04 \x01(\x0b\x32&.injective.stream.v1beta1.TradesFilterB\x04\xc8\xde\x1f\x01R\x16\x64\x65rivativeTradesFilter\x12Z\n\x12spot_orders_filter\x18\x05 \x01(\x0b\x32&.injective.stream.v1beta1.OrdersFilterB\x04\xc8\xde\x1f\x01R\x10spotOrdersFilter\x12\x66\n\x18\x64\x65rivative_orders_filter\x18\x06 \x01(\x0b\x32&.injective.stream.v1beta1.OrdersFilterB\x04\xc8\xde\x1f\x01R\x16\x64\x65rivativeOrdersFilter\x12\x65\n\x16spot_orderbooks_filter\x18\x07 \x01(\x0b\x32).injective.stream.v1beta1.OrderbookFilterB\x04\xc8\xde\x1f\x01R\x14spotOrderbooksFilter\x12q\n\x1c\x64\x65rivative_orderbooks_filter\x18\x08 \x01(\x0b\x32).injective.stream.v1beta1.OrderbookFilterB\x04\xc8\xde\x1f\x01R\x1a\x64\x65rivativeOrderbooksFilter\x12Z\n\x10positions_filter\x18\t \x01(\x0b\x32).injective.stream.v1beta1.PositionsFilterB\x04\xc8\xde\x1f\x01R\x0fpositionsFilter\x12\x61\n\x13oracle_price_filter\x18\n \x01(\x0b\x32+.injective.stream.v1beta1.OraclePriceFilterB\x04\xc8\xde\x1f\x01R\x11oraclePriceFilter\"\xa1\x07\n\x0eStreamResponse\x12!\n\x0c\x62lock_height\x18\x01 \x01(\x04R\x0b\x62lockHeight\x12\x1d\n\nblock_time\x18\x02 \x01(\x03R\tblockTime\x12J\n\rbank_balances\x18\x03 \x03(\x0b\x32%.injective.stream.v1beta1.BankBalanceR\x0c\x62\x61nkBalances\x12]\n\x13subaccount_deposits\x18\x04 \x03(\x0b\x32,.injective.stream.v1beta1.SubaccountDepositsR\x12subaccountDeposits\x12\x44\n\x0bspot_trades\x18\x05 \x03(\x0b\x32#.injective.stream.v1beta1.SpotTradeR\nspotTrades\x12V\n\x11\x64\x65rivative_trades\x18\x06 \x03(\x0b\x32).injective.stream.v1beta1.DerivativeTradeR\x10\x64\x65rivativeTrades\x12J\n\x0bspot_orders\x18\x07 \x03(\x0b\x32).injective.stream.v1beta1.SpotOrderUpdateR\nspotOrders\x12\\\n\x11\x64\x65rivative_orders\x18\x08 \x03(\x0b\x32/.injective.stream.v1beta1.DerivativeOrderUpdateR\x10\x64\x65rivativeOrders\x12_\n\x16spot_orderbook_updates\x18\t \x03(\x0b\x32).injective.stream.v1beta1.OrderbookUpdateR\x14spotOrderbookUpdates\x12k\n\x1c\x64\x65rivative_orderbook_updates\x18\n \x03(\x0b\x32).injective.stream.v1beta1.OrderbookUpdateR\x1a\x64\x65rivativeOrderbookUpdates\x12@\n\tpositions\x18\x0b \x03(\x0b\x32\".injective.stream.v1beta1.PositionR\tpositions\x12J\n\roracle_prices\x18\x0c \x03(\x0b\x32%.injective.stream.v1beta1.OraclePriceR\x0coraclePrices\"f\n\x0fOrderbookUpdate\x12\x10\n\x03seq\x18\x01 \x01(\x04R\x03seq\x12\x41\n\torderbook\x18\x02 \x01(\x0b\x32#.injective.stream.v1beta1.OrderbookR\torderbook\"\xa4\x01\n\tOrderbook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12;\n\nbuy_levels\x18\x02 \x03(\x0b\x32\x1c.injective.exchange.v2.LevelR\tbuyLevels\x12=\n\x0bsell_levels\x18\x03 \x03(\x0b\x32\x1c.injective.exchange.v2.LevelR\nsellLevels\"\x90\x01\n\x0b\x42\x61nkBalance\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12g\n\x08\x62\x61lances\x18\x02 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinB0\xc8\xde\x1f\x00\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.CoinsR\x08\x62\x61lances\"\x88\x01\n\x12SubaccountDeposits\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12M\n\x08\x64\x65posits\x18\x02 \x03(\x0b\x32+.injective.stream.v1beta1.SubaccountDepositB\x04\xc8\xde\x1f\x00R\x08\x64\x65posits\"i\n\x11SubaccountDeposit\x12\x14\n\x05\x64\x65nom\x18\x01 \x01(\tR\x05\x64\x65nom\x12>\n\x07\x64\x65posit\x18\x02 \x01(\x0b\x32\x1e.injective.exchange.v2.DepositB\x04\xc8\xde\x1f\x00R\x07\x64\x65posit\"\xc2\x01\n\x0fSpotOrderUpdate\x12\x43\n\x06status\x18\x01 \x01(\x0e\x32+.injective.stream.v1beta1.OrderUpdateStatusR\x06status\x12\x1d\n\norder_hash\x18\x02 \x01(\tR\torderHash\x12\x10\n\x03\x63id\x18\x03 \x01(\tR\x03\x63id\x12\x39\n\x05order\x18\x04 \x01(\x0b\x32#.injective.stream.v1beta1.SpotOrderR\x05order\"k\n\tSpotOrder\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x41\n\x05order\x18\x02 \x01(\x0b\x32%.injective.exchange.v2.SpotLimitOrderB\x04\xc8\xde\x1f\x00R\x05order\"\xce\x01\n\x15\x44\x65rivativeOrderUpdate\x12\x43\n\x06status\x18\x01 \x01(\x0e\x32+.injective.stream.v1beta1.OrderUpdateStatusR\x06status\x12\x1d\n\norder_hash\x18\x02 \x01(\tR\torderHash\x12\x10\n\x03\x63id\x18\x03 \x01(\tR\x03\x63id\x12?\n\x05order\x18\x04 \x01(\x0b\x32).injective.stream.v1beta1.DerivativeOrderR\x05order\"\x94\x01\n\x0f\x44\x65rivativeOrder\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12G\n\x05order\x18\x02 \x01(\x0b\x32+.injective.exchange.v2.DerivativeLimitOrderB\x04\xc8\xde\x1f\x00R\x05order\x12\x1b\n\tis_market\x18\x03 \x01(\x08R\x08isMarket\"\x87\x03\n\x08Position\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12#\n\rsubaccount_id\x18\x02 \x01(\tR\x0csubaccountId\x12\x16\n\x06isLong\x18\x03 \x01(\x08R\x06isLong\x12?\n\x08quantity\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x08quantity\x12\x44\n\x0b\x65ntry_price\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\nentryPrice\x12;\n\x06margin\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06margin\x12]\n\x18\x63umulative_funding_entry\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x16\x63umulativeFundingEntry\"t\n\x0bOraclePrice\x12\x16\n\x06symbol\x18\x01 \x01(\tR\x06symbol\x12\x39\n\x05price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x05price\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\"\xc3\x03\n\tSpotTrade\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x15\n\x06is_buy\x18\x02 \x01(\x08R\x05isBuy\x12$\n\rexecutionType\x18\x03 \x01(\tR\rexecutionType\x12?\n\x08quantity\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x08quantity\x12\x39\n\x05price\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x05price\x12#\n\rsubaccount_id\x18\x06 \x01(\tR\x0csubaccountId\x12\x35\n\x03\x66\x65\x65\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x03\x66\x65\x65\x12\x1d\n\norder_hash\x18\x08 \x01(\tR\torderHash\x12\x38\n\x15\x66\x65\x65_recipient_address\x18\t \x01(\tB\x04\xc8\xde\x1f\x01R\x13\x66\x65\x65RecipientAddress\x12\x10\n\x03\x63id\x18\n \x01(\tR\x03\x63id\x12\x19\n\x08trade_id\x18\x0b \x01(\tR\x07tradeId\"\xd7\x03\n\x0f\x44\x65rivativeTrade\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x15\n\x06is_buy\x18\x02 \x01(\x08R\x05isBuy\x12$\n\rexecutionType\x18\x03 \x01(\tR\rexecutionType\x12#\n\rsubaccount_id\x18\x04 \x01(\tR\x0csubaccountId\x12K\n\x0eposition_delta\x18\x05 \x01(\x0b\x32$.injective.exchange.v2.PositionDeltaR\rpositionDelta\x12;\n\x06payout\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06payout\x12\x35\n\x03\x66\x65\x65\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x03\x66\x65\x65\x12\x1d\n\norder_hash\x18\x08 \x01(\tR\torderHash\x12\x38\n\x15\x66\x65\x65_recipient_address\x18\t \x01(\tB\x04\xc8\xde\x1f\x01R\x13\x66\x65\x65RecipientAddress\x12\x10\n\x03\x63id\x18\n \x01(\tR\x03\x63id\x12\x19\n\x08trade_id\x18\x0b \x01(\tR\x07tradeId\"T\n\x0cTradesFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"W\n\x0fPositionsFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"T\n\x0cOrdersFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"0\n\x0fOrderbookFilter\x12\x1d\n\nmarket_ids\x18\x01 \x03(\tR\tmarketIds\"0\n\x12\x42\x61nkBalancesFilter\x12\x1a\n\x08\x61\x63\x63ounts\x18\x01 \x03(\tR\x08\x61\x63\x63ounts\"A\n\x18SubaccountDepositsFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\"+\n\x11OraclePriceFilter\x12\x16\n\x06symbol\x18\x01 \x03(\tR\x06symbol*L\n\x11OrderUpdateStatus\x12\x0f\n\x0bUnspecified\x10\x00\x12\n\n\x06\x42ooked\x10\x01\x12\x0b\n\x07Matched\x10\x02\x12\r\n\tCancelled\x10\x03\x32g\n\x06Stream\x12]\n\x06Stream\x12\'.injective.stream.v1beta1.StreamRequest\x1a(.injective.stream.v1beta1.StreamResponse0\x01\x42\xf2\x01\n\x1c\x63om.injective.stream.v1beta1B\nQueryProtoP\x01ZDgithub.com/InjectiveLabs/injective-core/injective-chain/stream/types\xa2\x02\x03ISX\xaa\x02\x18Injective.Stream.V1beta1\xca\x02\x18Injective\\Stream\\V1beta1\xe2\x02$Injective\\Stream\\V1beta1\\GPBMetadata\xea\x02\x1aInjective::Stream::V1beta1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$injective/stream/v1beta1/query.proto\x12\x18injective.stream.v1beta1\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x14gogoproto/gogo.proto\x1a\'injective/exchange/v1beta1/events.proto\x1a)injective/exchange/v1beta1/exchange.proto\"\x8e\x08\n\rStreamRequest\x12\x64\n\x14\x62\x61nk_balances_filter\x18\x01 \x01(\x0b\x32,.injective.stream.v1beta1.BankBalancesFilterB\x04\xc8\xde\x1f\x01R\x12\x62\x61nkBalancesFilter\x12v\n\x1asubaccount_deposits_filter\x18\x02 \x01(\x0b\x32\x32.injective.stream.v1beta1.SubaccountDepositsFilterB\x04\xc8\xde\x1f\x01R\x18subaccountDepositsFilter\x12Z\n\x12spot_trades_filter\x18\x03 \x01(\x0b\x32&.injective.stream.v1beta1.TradesFilterB\x04\xc8\xde\x1f\x01R\x10spotTradesFilter\x12\x66\n\x18\x64\x65rivative_trades_filter\x18\x04 \x01(\x0b\x32&.injective.stream.v1beta1.TradesFilterB\x04\xc8\xde\x1f\x01R\x16\x64\x65rivativeTradesFilter\x12Z\n\x12spot_orders_filter\x18\x05 \x01(\x0b\x32&.injective.stream.v1beta1.OrdersFilterB\x04\xc8\xde\x1f\x01R\x10spotOrdersFilter\x12\x66\n\x18\x64\x65rivative_orders_filter\x18\x06 \x01(\x0b\x32&.injective.stream.v1beta1.OrdersFilterB\x04\xc8\xde\x1f\x01R\x16\x64\x65rivativeOrdersFilter\x12\x65\n\x16spot_orderbooks_filter\x18\x07 \x01(\x0b\x32).injective.stream.v1beta1.OrderbookFilterB\x04\xc8\xde\x1f\x01R\x14spotOrderbooksFilter\x12q\n\x1c\x64\x65rivative_orderbooks_filter\x18\x08 \x01(\x0b\x32).injective.stream.v1beta1.OrderbookFilterB\x04\xc8\xde\x1f\x01R\x1a\x64\x65rivativeOrderbooksFilter\x12Z\n\x10positions_filter\x18\t \x01(\x0b\x32).injective.stream.v1beta1.PositionsFilterB\x04\xc8\xde\x1f\x01R\x0fpositionsFilter\x12\x61\n\x13oracle_price_filter\x18\n \x01(\x0b\x32+.injective.stream.v1beta1.OraclePriceFilterB\x04\xc8\xde\x1f\x01R\x11oraclePriceFilter\"\xa1\x07\n\x0eStreamResponse\x12!\n\x0c\x62lock_height\x18\x01 \x01(\x04R\x0b\x62lockHeight\x12\x1d\n\nblock_time\x18\x02 \x01(\x03R\tblockTime\x12J\n\rbank_balances\x18\x03 \x03(\x0b\x32%.injective.stream.v1beta1.BankBalanceR\x0c\x62\x61nkBalances\x12]\n\x13subaccount_deposits\x18\x04 \x03(\x0b\x32,.injective.stream.v1beta1.SubaccountDepositsR\x12subaccountDeposits\x12\x44\n\x0bspot_trades\x18\x05 \x03(\x0b\x32#.injective.stream.v1beta1.SpotTradeR\nspotTrades\x12V\n\x11\x64\x65rivative_trades\x18\x06 \x03(\x0b\x32).injective.stream.v1beta1.DerivativeTradeR\x10\x64\x65rivativeTrades\x12J\n\x0bspot_orders\x18\x07 \x03(\x0b\x32).injective.stream.v1beta1.SpotOrderUpdateR\nspotOrders\x12\\\n\x11\x64\x65rivative_orders\x18\x08 \x03(\x0b\x32/.injective.stream.v1beta1.DerivativeOrderUpdateR\x10\x64\x65rivativeOrders\x12_\n\x16spot_orderbook_updates\x18\t \x03(\x0b\x32).injective.stream.v1beta1.OrderbookUpdateR\x14spotOrderbookUpdates\x12k\n\x1c\x64\x65rivative_orderbook_updates\x18\n \x03(\x0b\x32).injective.stream.v1beta1.OrderbookUpdateR\x1a\x64\x65rivativeOrderbookUpdates\x12@\n\tpositions\x18\x0b \x03(\x0b\x32\".injective.stream.v1beta1.PositionR\tpositions\x12J\n\roracle_prices\x18\x0c \x03(\x0b\x32%.injective.stream.v1beta1.OraclePriceR\x0coraclePrices\"f\n\x0fOrderbookUpdate\x12\x10\n\x03seq\x18\x01 \x01(\x04R\x03seq\x12\x41\n\torderbook\x18\x02 \x01(\x0b\x32#.injective.stream.v1beta1.OrderbookR\torderbook\"\xae\x01\n\tOrderbook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12@\n\nbuy_levels\x18\x02 \x03(\x0b\x32!.injective.exchange.v1beta1.LevelR\tbuyLevels\x12\x42\n\x0bsell_levels\x18\x03 \x03(\x0b\x32!.injective.exchange.v1beta1.LevelR\nsellLevels\"\x90\x01\n\x0b\x42\x61nkBalance\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12g\n\x08\x62\x61lances\x18\x02 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinB0\xc8\xde\x1f\x00\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.CoinsR\x08\x62\x61lances\"\x88\x01\n\x12SubaccountDeposits\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12M\n\x08\x64\x65posits\x18\x02 \x03(\x0b\x32+.injective.stream.v1beta1.SubaccountDepositB\x04\xc8\xde\x1f\x00R\x08\x64\x65posits\"n\n\x11SubaccountDeposit\x12\x14\n\x05\x64\x65nom\x18\x01 \x01(\tR\x05\x64\x65nom\x12\x43\n\x07\x64\x65posit\x18\x02 \x01(\x0b\x32#.injective.exchange.v1beta1.DepositB\x04\xc8\xde\x1f\x00R\x07\x64\x65posit\"\xc2\x01\n\x0fSpotOrderUpdate\x12\x43\n\x06status\x18\x01 \x01(\x0e\x32+.injective.stream.v1beta1.OrderUpdateStatusR\x06status\x12\x1d\n\norder_hash\x18\x02 \x01(\tR\torderHash\x12\x10\n\x03\x63id\x18\x03 \x01(\tR\x03\x63id\x12\x39\n\x05order\x18\x04 \x01(\x0b\x32#.injective.stream.v1beta1.SpotOrderR\x05order\"p\n\tSpotOrder\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x46\n\x05order\x18\x02 \x01(\x0b\x32*.injective.exchange.v1beta1.SpotLimitOrderB\x04\xc8\xde\x1f\x00R\x05order\"\xce\x01\n\x15\x44\x65rivativeOrderUpdate\x12\x43\n\x06status\x18\x01 \x01(\x0e\x32+.injective.stream.v1beta1.OrderUpdateStatusR\x06status\x12\x1d\n\norder_hash\x18\x02 \x01(\tR\torderHash\x12\x10\n\x03\x63id\x18\x03 \x01(\tR\x03\x63id\x12?\n\x05order\x18\x04 \x01(\x0b\x32).injective.stream.v1beta1.DerivativeOrderR\x05order\"\x99\x01\n\x0f\x44\x65rivativeOrder\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12L\n\x05order\x18\x02 \x01(\x0b\x32\x30.injective.exchange.v1beta1.DerivativeLimitOrderB\x04\xc8\xde\x1f\x00R\x05order\x12\x1b\n\tis_market\x18\x03 \x01(\x08R\x08isMarket\"\x87\x03\n\x08Position\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12#\n\rsubaccount_id\x18\x02 \x01(\tR\x0csubaccountId\x12\x16\n\x06isLong\x18\x03 \x01(\x08R\x06isLong\x12?\n\x08quantity\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x08quantity\x12\x44\n\x0b\x65ntry_price\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\nentryPrice\x12;\n\x06margin\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06margin\x12]\n\x18\x63umulative_funding_entry\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x16\x63umulativeFundingEntry\"t\n\x0bOraclePrice\x12\x16\n\x06symbol\x18\x01 \x01(\tR\x06symbol\x12\x39\n\x05price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x05price\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\"\xc3\x03\n\tSpotTrade\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x15\n\x06is_buy\x18\x02 \x01(\x08R\x05isBuy\x12$\n\rexecutionType\x18\x03 \x01(\tR\rexecutionType\x12?\n\x08quantity\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x08quantity\x12\x39\n\x05price\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x05price\x12#\n\rsubaccount_id\x18\x06 \x01(\tR\x0csubaccountId\x12\x35\n\x03\x66\x65\x65\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x03\x66\x65\x65\x12\x1d\n\norder_hash\x18\x08 \x01(\tR\torderHash\x12\x38\n\x15\x66\x65\x65_recipient_address\x18\t \x01(\tB\x04\xc8\xde\x1f\x01R\x13\x66\x65\x65RecipientAddress\x12\x10\n\x03\x63id\x18\n \x01(\tR\x03\x63id\x12\x19\n\x08trade_id\x18\x0b \x01(\tR\x07tradeId\"\xdc\x03\n\x0f\x44\x65rivativeTrade\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x15\n\x06is_buy\x18\x02 \x01(\x08R\x05isBuy\x12$\n\rexecutionType\x18\x03 \x01(\tR\rexecutionType\x12#\n\rsubaccount_id\x18\x04 \x01(\tR\x0csubaccountId\x12P\n\x0eposition_delta\x18\x05 \x01(\x0b\x32).injective.exchange.v1beta1.PositionDeltaR\rpositionDelta\x12;\n\x06payout\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06payout\x12\x35\n\x03\x66\x65\x65\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x03\x66\x65\x65\x12\x1d\n\norder_hash\x18\x08 \x01(\tR\torderHash\x12\x38\n\x15\x66\x65\x65_recipient_address\x18\t \x01(\tB\x04\xc8\xde\x1f\x01R\x13\x66\x65\x65RecipientAddress\x12\x10\n\x03\x63id\x18\n \x01(\tR\x03\x63id\x12\x19\n\x08trade_id\x18\x0b \x01(\tR\x07tradeId\"T\n\x0cTradesFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"W\n\x0fPositionsFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"T\n\x0cOrdersFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"0\n\x0fOrderbookFilter\x12\x1d\n\nmarket_ids\x18\x01 \x03(\tR\tmarketIds\"0\n\x12\x42\x61nkBalancesFilter\x12\x1a\n\x08\x61\x63\x63ounts\x18\x01 \x03(\tR\x08\x61\x63\x63ounts\"A\n\x18SubaccountDepositsFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\"+\n\x11OraclePriceFilter\x12\x16\n\x06symbol\x18\x01 \x03(\tR\x06symbol*L\n\x11OrderUpdateStatus\x12\x0f\n\x0bUnspecified\x10\x00\x12\n\n\x06\x42ooked\x10\x01\x12\x0b\n\x07Matched\x10\x02\x12\r\n\tCancelled\x10\x03\x32g\n\x06Stream\x12]\n\x06Stream\x12\'.injective.stream.v1beta1.StreamRequest\x1a(.injective.stream.v1beta1.StreamResponse0\x01\x42\xf2\x01\n\x1c\x63om.injective.stream.v1beta1B\nQueryProtoP\x01ZDgithub.com/InjectiveLabs/injective-core/injective-chain/stream/types\xa2\x02\x03ISX\xaa\x02\x18Injective.Stream.V1beta1\xca\x02\x18Injective\\Stream\\V1beta1\xe2\x02$Injective\\Stream\\V1beta1\\GPBMetadata\xea\x02\x1aInjective::Stream::V1beta1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -81,29 +80,29 @@ _globals['_DERIVATIVETRADE'].fields_by_name['fee']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' _globals['_DERIVATIVETRADE'].fields_by_name['fee_recipient_address']._loaded_options = None _globals['_DERIVATIVETRADE'].fields_by_name['fee_recipient_address']._serialized_options = b'\310\336\037\001' - _globals['_ORDERUPDATESTATUS']._serialized_start=5445 - _globals['_ORDERUPDATESTATUS']._serialized_end=5521 - _globals['_STREAMREQUEST']._serialized_start=230 - _globals['_STREAMREQUEST']._serialized_end=1268 - _globals['_STREAMRESPONSE']._serialized_start=1271 - _globals['_STREAMRESPONSE']._serialized_end=2200 - _globals['_ORDERBOOKUPDATE']._serialized_start=2202 - _globals['_ORDERBOOKUPDATE']._serialized_end=2304 - _globals['_ORDERBOOK']._serialized_start=2307 - _globals['_ORDERBOOK']._serialized_end=2471 - _globals['_BANKBALANCE']._serialized_start=2474 - _globals['_BANKBALANCE']._serialized_end=2618 - _globals['_SUBACCOUNTDEPOSITS']._serialized_start=2621 - _globals['_SUBACCOUNTDEPOSITS']._serialized_end=2757 - _globals['_SUBACCOUNTDEPOSIT']._serialized_start=2759 - _globals['_SUBACCOUNTDEPOSIT']._serialized_end=2864 - _globals['_SPOTORDERUPDATE']._serialized_start=2867 - _globals['_SPOTORDERUPDATE']._serialized_end=3061 - _globals['_SPOTORDER']._serialized_start=3063 - _globals['_SPOTORDER']._serialized_end=3170 - _globals['_DERIVATIVEORDERUPDATE']._serialized_start=3173 - _globals['_DERIVATIVEORDERUPDATE']._serialized_end=3379 - _globals['_DERIVATIVEORDER']._serialized_start=3382 + _globals['_ORDERUPDATESTATUS']._serialized_start=5450 + _globals['_ORDERUPDATESTATUS']._serialized_end=5526 + _globals['_STREAMREQUEST']._serialized_start=205 + _globals['_STREAMREQUEST']._serialized_end=1243 + _globals['_STREAMRESPONSE']._serialized_start=1246 + _globals['_STREAMRESPONSE']._serialized_end=2175 + _globals['_ORDERBOOKUPDATE']._serialized_start=2177 + _globals['_ORDERBOOKUPDATE']._serialized_end=2279 + _globals['_ORDERBOOK']._serialized_start=2282 + _globals['_ORDERBOOK']._serialized_end=2456 + _globals['_BANKBALANCE']._serialized_start=2459 + _globals['_BANKBALANCE']._serialized_end=2603 + _globals['_SUBACCOUNTDEPOSITS']._serialized_start=2606 + _globals['_SUBACCOUNTDEPOSITS']._serialized_end=2742 + _globals['_SUBACCOUNTDEPOSIT']._serialized_start=2744 + _globals['_SUBACCOUNTDEPOSIT']._serialized_end=2854 + _globals['_SPOTORDERUPDATE']._serialized_start=2857 + _globals['_SPOTORDERUPDATE']._serialized_end=3051 + _globals['_SPOTORDER']._serialized_start=3053 + _globals['_SPOTORDER']._serialized_end=3165 + _globals['_DERIVATIVEORDERUPDATE']._serialized_start=3168 + _globals['_DERIVATIVEORDERUPDATE']._serialized_end=3374 + _globals['_DERIVATIVEORDER']._serialized_start=3377 _globals['_DERIVATIVEORDER']._serialized_end=3530 _globals['_POSITION']._serialized_start=3533 _globals['_POSITION']._serialized_end=3924 @@ -112,21 +111,21 @@ _globals['_SPOTTRADE']._serialized_start=4045 _globals['_SPOTTRADE']._serialized_end=4496 _globals['_DERIVATIVETRADE']._serialized_start=4499 - _globals['_DERIVATIVETRADE']._serialized_end=4970 - _globals['_TRADESFILTER']._serialized_start=4972 - _globals['_TRADESFILTER']._serialized_end=5056 - _globals['_POSITIONSFILTER']._serialized_start=5058 - _globals['_POSITIONSFILTER']._serialized_end=5145 - _globals['_ORDERSFILTER']._serialized_start=5147 - _globals['_ORDERSFILTER']._serialized_end=5231 - _globals['_ORDERBOOKFILTER']._serialized_start=5233 - _globals['_ORDERBOOKFILTER']._serialized_end=5281 - _globals['_BANKBALANCESFILTER']._serialized_start=5283 - _globals['_BANKBALANCESFILTER']._serialized_end=5331 - _globals['_SUBACCOUNTDEPOSITSFILTER']._serialized_start=5333 - _globals['_SUBACCOUNTDEPOSITSFILTER']._serialized_end=5398 - _globals['_ORACLEPRICEFILTER']._serialized_start=5400 - _globals['_ORACLEPRICEFILTER']._serialized_end=5443 - _globals['_STREAM']._serialized_start=5523 - _globals['_STREAM']._serialized_end=5626 + _globals['_DERIVATIVETRADE']._serialized_end=4975 + _globals['_TRADESFILTER']._serialized_start=4977 + _globals['_TRADESFILTER']._serialized_end=5061 + _globals['_POSITIONSFILTER']._serialized_start=5063 + _globals['_POSITIONSFILTER']._serialized_end=5150 + _globals['_ORDERSFILTER']._serialized_start=5152 + _globals['_ORDERSFILTER']._serialized_end=5236 + _globals['_ORDERBOOKFILTER']._serialized_start=5238 + _globals['_ORDERBOOKFILTER']._serialized_end=5286 + _globals['_BANKBALANCESFILTER']._serialized_start=5288 + _globals['_BANKBALANCESFILTER']._serialized_end=5336 + _globals['_SUBACCOUNTDEPOSITSFILTER']._serialized_start=5338 + _globals['_SUBACCOUNTDEPOSITSFILTER']._serialized_end=5403 + _globals['_ORACLEPRICEFILTER']._serialized_start=5405 + _globals['_ORACLEPRICEFILTER']._serialized_end=5448 + _globals['_STREAM']._serialized_start=5528 + _globals['_STREAM']._serialized_end=5631 # @@protoc_insertion_point(module_scope) diff --git a/pyinjective/proto/injective/stream/v2/query_pb2.py b/pyinjective/proto/injective/stream/v2/query_pb2.py new file mode 100644 index 00000000..0c35f781 --- /dev/null +++ b/pyinjective/proto/injective/stream/v2/query_pb2.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: injective/stream/v2/query.proto +# Protobuf Python Version: 5.26.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from pyinjective.proto.cosmos.base.v1beta1 import coin_pb2 as cosmos_dot_base_dot_v1beta1_dot_coin__pb2 +from pyinjective.proto.gogoproto import gogo_pb2 as gogoproto_dot_gogo__pb2 +from pyinjective.proto.injective.exchange.v2 import events_pb2 as injective_dot_exchange_dot_v2_dot_events__pb2 +from pyinjective.proto.injective.exchange.v2 import exchange_pb2 as injective_dot_exchange_dot_v2_dot_exchange__pb2 +from pyinjective.proto.injective.exchange.v2 import order_pb2 as injective_dot_exchange_dot_v2_dot_order__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1finjective/stream/v2/query.proto\x12\x13injective.stream.v2\x1a\x1e\x63osmos/base/v1beta1/coin.proto\x1a\x14gogoproto/gogo.proto\x1a\"injective/exchange/v2/events.proto\x1a$injective/exchange/v2/exchange.proto\x1a!injective/exchange/v2/order.proto\"\xdc\x07\n\rStreamRequest\x12_\n\x14\x62\x61nk_balances_filter\x18\x01 \x01(\x0b\x32\'.injective.stream.v2.BankBalancesFilterB\x04\xc8\xde\x1f\x01R\x12\x62\x61nkBalancesFilter\x12q\n\x1asubaccount_deposits_filter\x18\x02 \x01(\x0b\x32-.injective.stream.v2.SubaccountDepositsFilterB\x04\xc8\xde\x1f\x01R\x18subaccountDepositsFilter\x12U\n\x12spot_trades_filter\x18\x03 \x01(\x0b\x32!.injective.stream.v2.TradesFilterB\x04\xc8\xde\x1f\x01R\x10spotTradesFilter\x12\x61\n\x18\x64\x65rivative_trades_filter\x18\x04 \x01(\x0b\x32!.injective.stream.v2.TradesFilterB\x04\xc8\xde\x1f\x01R\x16\x64\x65rivativeTradesFilter\x12U\n\x12spot_orders_filter\x18\x05 \x01(\x0b\x32!.injective.stream.v2.OrdersFilterB\x04\xc8\xde\x1f\x01R\x10spotOrdersFilter\x12\x61\n\x18\x64\x65rivative_orders_filter\x18\x06 \x01(\x0b\x32!.injective.stream.v2.OrdersFilterB\x04\xc8\xde\x1f\x01R\x16\x64\x65rivativeOrdersFilter\x12`\n\x16spot_orderbooks_filter\x18\x07 \x01(\x0b\x32$.injective.stream.v2.OrderbookFilterB\x04\xc8\xde\x1f\x01R\x14spotOrderbooksFilter\x12l\n\x1c\x64\x65rivative_orderbooks_filter\x18\x08 \x01(\x0b\x32$.injective.stream.v2.OrderbookFilterB\x04\xc8\xde\x1f\x01R\x1a\x64\x65rivativeOrderbooksFilter\x12U\n\x10positions_filter\x18\t \x01(\x0b\x32$.injective.stream.v2.PositionsFilterB\x04\xc8\xde\x1f\x01R\x0fpositionsFilter\x12\\\n\x13oracle_price_filter\x18\n \x01(\x0b\x32&.injective.stream.v2.OraclePriceFilterB\x04\xc8\xde\x1f\x01R\x11oraclePriceFilter\"\xef\x06\n\x0eStreamResponse\x12!\n\x0c\x62lock_height\x18\x01 \x01(\x04R\x0b\x62lockHeight\x12\x1d\n\nblock_time\x18\x02 \x01(\x03R\tblockTime\x12\x45\n\rbank_balances\x18\x03 \x03(\x0b\x32 .injective.stream.v2.BankBalanceR\x0c\x62\x61nkBalances\x12X\n\x13subaccount_deposits\x18\x04 \x03(\x0b\x32\'.injective.stream.v2.SubaccountDepositsR\x12subaccountDeposits\x12?\n\x0bspot_trades\x18\x05 \x03(\x0b\x32\x1e.injective.stream.v2.SpotTradeR\nspotTrades\x12Q\n\x11\x64\x65rivative_trades\x18\x06 \x03(\x0b\x32$.injective.stream.v2.DerivativeTradeR\x10\x64\x65rivativeTrades\x12\x45\n\x0bspot_orders\x18\x07 \x03(\x0b\x32$.injective.stream.v2.SpotOrderUpdateR\nspotOrders\x12W\n\x11\x64\x65rivative_orders\x18\x08 \x03(\x0b\x32*.injective.stream.v2.DerivativeOrderUpdateR\x10\x64\x65rivativeOrders\x12Z\n\x16spot_orderbook_updates\x18\t \x03(\x0b\x32$.injective.stream.v2.OrderbookUpdateR\x14spotOrderbookUpdates\x12\x66\n\x1c\x64\x65rivative_orderbook_updates\x18\n \x03(\x0b\x32$.injective.stream.v2.OrderbookUpdateR\x1a\x64\x65rivativeOrderbookUpdates\x12;\n\tpositions\x18\x0b \x03(\x0b\x32\x1d.injective.stream.v2.PositionR\tpositions\x12\x45\n\roracle_prices\x18\x0c \x03(\x0b\x32 .injective.stream.v2.OraclePriceR\x0coraclePrices\"a\n\x0fOrderbookUpdate\x12\x10\n\x03seq\x18\x01 \x01(\x04R\x03seq\x12<\n\torderbook\x18\x02 \x01(\x0b\x32\x1e.injective.stream.v2.OrderbookR\torderbook\"\xa4\x01\n\tOrderbook\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12;\n\nbuy_levels\x18\x02 \x03(\x0b\x32\x1c.injective.exchange.v2.LevelR\tbuyLevels\x12=\n\x0bsell_levels\x18\x03 \x03(\x0b\x32\x1c.injective.exchange.v2.LevelR\nsellLevels\"\x90\x01\n\x0b\x42\x61nkBalance\x12\x18\n\x07\x61\x63\x63ount\x18\x01 \x01(\tR\x07\x61\x63\x63ount\x12g\n\x08\x62\x61lances\x18\x02 \x03(\x0b\x32\x19.cosmos.base.v1beta1.CoinB0\xc8\xde\x1f\x00\xaa\xdf\x1f(github.com/cosmos/cosmos-sdk/types.CoinsR\x08\x62\x61lances\"\x83\x01\n\x12SubaccountDeposits\x12#\n\rsubaccount_id\x18\x01 \x01(\tR\x0csubaccountId\x12H\n\x08\x64\x65posits\x18\x02 \x03(\x0b\x32&.injective.stream.v2.SubaccountDepositB\x04\xc8\xde\x1f\x00R\x08\x64\x65posits\"i\n\x11SubaccountDeposit\x12\x14\n\x05\x64\x65nom\x18\x01 \x01(\tR\x05\x64\x65nom\x12>\n\x07\x64\x65posit\x18\x02 \x01(\x0b\x32\x1e.injective.exchange.v2.DepositB\x04\xc8\xde\x1f\x00R\x07\x64\x65posit\"\xb8\x01\n\x0fSpotOrderUpdate\x12>\n\x06status\x18\x01 \x01(\x0e\x32&.injective.stream.v2.OrderUpdateStatusR\x06status\x12\x1d\n\norder_hash\x18\x02 \x01(\tR\torderHash\x12\x10\n\x03\x63id\x18\x03 \x01(\tR\x03\x63id\x12\x34\n\x05order\x18\x04 \x01(\x0b\x32\x1e.injective.stream.v2.SpotOrderR\x05order\"k\n\tSpotOrder\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x41\n\x05order\x18\x02 \x01(\x0b\x32%.injective.exchange.v2.SpotLimitOrderB\x04\xc8\xde\x1f\x00R\x05order\"\xc4\x01\n\x15\x44\x65rivativeOrderUpdate\x12>\n\x06status\x18\x01 \x01(\x0e\x32&.injective.stream.v2.OrderUpdateStatusR\x06status\x12\x1d\n\norder_hash\x18\x02 \x01(\tR\torderHash\x12\x10\n\x03\x63id\x18\x03 \x01(\tR\x03\x63id\x12:\n\x05order\x18\x04 \x01(\x0b\x32$.injective.stream.v2.DerivativeOrderR\x05order\"\x94\x01\n\x0f\x44\x65rivativeOrder\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12G\n\x05order\x18\x02 \x01(\x0b\x32+.injective.exchange.v2.DerivativeLimitOrderB\x04\xc8\xde\x1f\x00R\x05order\x12\x1b\n\tis_market\x18\x03 \x01(\x08R\x08isMarket\"\x87\x03\n\x08Position\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12#\n\rsubaccount_id\x18\x02 \x01(\tR\x0csubaccountId\x12\x16\n\x06isLong\x18\x03 \x01(\x08R\x06isLong\x12?\n\x08quantity\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x08quantity\x12\x44\n\x0b\x65ntry_price\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\nentryPrice\x12;\n\x06margin\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06margin\x12]\n\x18\x63umulative_funding_entry\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x16\x63umulativeFundingEntry\"t\n\x0bOraclePrice\x12\x16\n\x06symbol\x18\x01 \x01(\tR\x06symbol\x12\x39\n\x05price\x18\x02 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x05price\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\"\xc3\x03\n\tSpotTrade\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x15\n\x06is_buy\x18\x02 \x01(\x08R\x05isBuy\x12$\n\rexecutionType\x18\x03 \x01(\tR\rexecutionType\x12?\n\x08quantity\x18\x04 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x08quantity\x12\x39\n\x05price\x18\x05 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x05price\x12#\n\rsubaccount_id\x18\x06 \x01(\tR\x0csubaccountId\x12\x35\n\x03\x66\x65\x65\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x03\x66\x65\x65\x12\x1d\n\norder_hash\x18\x08 \x01(\tR\torderHash\x12\x38\n\x15\x66\x65\x65_recipient_address\x18\t \x01(\tB\x04\xc8\xde\x1f\x01R\x13\x66\x65\x65RecipientAddress\x12\x10\n\x03\x63id\x18\n \x01(\tR\x03\x63id\x12\x19\n\x08trade_id\x18\x0b \x01(\tR\x07tradeId\"\xd7\x03\n\x0f\x44\x65rivativeTrade\x12\x1b\n\tmarket_id\x18\x01 \x01(\tR\x08marketId\x12\x15\n\x06is_buy\x18\x02 \x01(\x08R\x05isBuy\x12$\n\rexecutionType\x18\x03 \x01(\tR\rexecutionType\x12#\n\rsubaccount_id\x18\x04 \x01(\tR\x0csubaccountId\x12K\n\x0eposition_delta\x18\x05 \x01(\x0b\x32$.injective.exchange.v2.PositionDeltaR\rpositionDelta\x12;\n\x06payout\x18\x06 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x06payout\x12\x35\n\x03\x66\x65\x65\x18\x07 \x01(\tB#\xc8\xde\x1f\x00\xda\xde\x1f\x1b\x63osmossdk.io/math.LegacyDecR\x03\x66\x65\x65\x12\x1d\n\norder_hash\x18\x08 \x01(\tR\torderHash\x12\x38\n\x15\x66\x65\x65_recipient_address\x18\t \x01(\tB\x04\xc8\xde\x1f\x01R\x13\x66\x65\x65RecipientAddress\x12\x10\n\x03\x63id\x18\n \x01(\tR\x03\x63id\x12\x19\n\x08trade_id\x18\x0b \x01(\tR\x07tradeId\"T\n\x0cTradesFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"W\n\x0fPositionsFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"T\n\x0cOrdersFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\x12\x1d\n\nmarket_ids\x18\x02 \x03(\tR\tmarketIds\"0\n\x0fOrderbookFilter\x12\x1d\n\nmarket_ids\x18\x01 \x03(\tR\tmarketIds\"0\n\x12\x42\x61nkBalancesFilter\x12\x1a\n\x08\x61\x63\x63ounts\x18\x01 \x03(\tR\x08\x61\x63\x63ounts\"A\n\x18SubaccountDepositsFilter\x12%\n\x0esubaccount_ids\x18\x01 \x03(\tR\rsubaccountIds\"+\n\x11OraclePriceFilter\x12\x16\n\x06symbol\x18\x01 \x03(\tR\x06symbol*L\n\x11OrderUpdateStatus\x12\x0f\n\x0bUnspecified\x10\x00\x12\n\n\x06\x42ooked\x10\x01\x12\x0b\n\x07Matched\x10\x02\x12\r\n\tCancelled\x10\x03\x32_\n\x06Stream\x12U\n\x08StreamV2\x12\".injective.stream.v2.StreamRequest\x1a#.injective.stream.v2.StreamResponse0\x01\x42\xdc\x01\n\x17\x63om.injective.stream.v2B\nQueryProtoP\x01ZGgithub.com/InjectiveLabs/injective-core/injective-chain/stream/types/v2\xa2\x02\x03ISX\xaa\x02\x13Injective.Stream.V2\xca\x02\x13Injective\\Stream\\V2\xe2\x02\x1fInjective\\Stream\\V2\\GPBMetadata\xea\x02\x15Injective::Stream::V2b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'injective.stream.v2.query_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\027com.injective.stream.v2B\nQueryProtoP\001ZGgithub.com/InjectiveLabs/injective-core/injective-chain/stream/types/v2\242\002\003ISX\252\002\023Injective.Stream.V2\312\002\023Injective\\Stream\\V2\342\002\037Injective\\Stream\\V2\\GPBMetadata\352\002\025Injective::Stream::V2' + _globals['_STREAMREQUEST'].fields_by_name['bank_balances_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['bank_balances_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['subaccount_deposits_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['subaccount_deposits_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['spot_trades_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['spot_trades_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['derivative_trades_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['derivative_trades_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['spot_orders_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['spot_orders_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['derivative_orders_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['derivative_orders_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['spot_orderbooks_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['spot_orderbooks_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['derivative_orderbooks_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['derivative_orderbooks_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['positions_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['positions_filter']._serialized_options = b'\310\336\037\001' + _globals['_STREAMREQUEST'].fields_by_name['oracle_price_filter']._loaded_options = None + _globals['_STREAMREQUEST'].fields_by_name['oracle_price_filter']._serialized_options = b'\310\336\037\001' + _globals['_BANKBALANCE'].fields_by_name['balances']._loaded_options = None + _globals['_BANKBALANCE'].fields_by_name['balances']._serialized_options = b'\310\336\037\000\252\337\037(github.com/cosmos/cosmos-sdk/types.Coins' + _globals['_SUBACCOUNTDEPOSITS'].fields_by_name['deposits']._loaded_options = None + _globals['_SUBACCOUNTDEPOSITS'].fields_by_name['deposits']._serialized_options = b'\310\336\037\000' + _globals['_SUBACCOUNTDEPOSIT'].fields_by_name['deposit']._loaded_options = None + _globals['_SUBACCOUNTDEPOSIT'].fields_by_name['deposit']._serialized_options = b'\310\336\037\000' + _globals['_SPOTORDER'].fields_by_name['order']._loaded_options = None + _globals['_SPOTORDER'].fields_by_name['order']._serialized_options = b'\310\336\037\000' + _globals['_DERIVATIVEORDER'].fields_by_name['order']._loaded_options = None + _globals['_DERIVATIVEORDER'].fields_by_name['order']._serialized_options = b'\310\336\037\000' + _globals['_POSITION'].fields_by_name['quantity']._loaded_options = None + _globals['_POSITION'].fields_by_name['quantity']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_POSITION'].fields_by_name['entry_price']._loaded_options = None + _globals['_POSITION'].fields_by_name['entry_price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_POSITION'].fields_by_name['margin']._loaded_options = None + _globals['_POSITION'].fields_by_name['margin']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_POSITION'].fields_by_name['cumulative_funding_entry']._loaded_options = None + _globals['_POSITION'].fields_by_name['cumulative_funding_entry']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_ORACLEPRICE'].fields_by_name['price']._loaded_options = None + _globals['_ORACLEPRICE'].fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_SPOTTRADE'].fields_by_name['quantity']._loaded_options = None + _globals['_SPOTTRADE'].fields_by_name['quantity']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_SPOTTRADE'].fields_by_name['price']._loaded_options = None + _globals['_SPOTTRADE'].fields_by_name['price']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_SPOTTRADE'].fields_by_name['fee']._loaded_options = None + _globals['_SPOTTRADE'].fields_by_name['fee']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_SPOTTRADE'].fields_by_name['fee_recipient_address']._loaded_options = None + _globals['_SPOTTRADE'].fields_by_name['fee_recipient_address']._serialized_options = b'\310\336\037\001' + _globals['_DERIVATIVETRADE'].fields_by_name['payout']._loaded_options = None + _globals['_DERIVATIVETRADE'].fields_by_name['payout']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_DERIVATIVETRADE'].fields_by_name['fee']._loaded_options = None + _globals['_DERIVATIVETRADE'].fields_by_name['fee']._serialized_options = b'\310\336\037\000\332\336\037\033cosmossdk.io/math.LegacyDec' + _globals['_DERIVATIVETRADE'].fields_by_name['fee_recipient_address']._loaded_options = None + _globals['_DERIVATIVETRADE'].fields_by_name['fee_recipient_address']._serialized_options = b'\310\336\037\001' + _globals['_ORDERUPDATESTATUS']._serialized_start=5305 + _globals['_ORDERUPDATESTATUS']._serialized_end=5381 + _globals['_STREAMREQUEST']._serialized_start=220 + _globals['_STREAMREQUEST']._serialized_end=1208 + _globals['_STREAMRESPONSE']._serialized_start=1211 + _globals['_STREAMRESPONSE']._serialized_end=2090 + _globals['_ORDERBOOKUPDATE']._serialized_start=2092 + _globals['_ORDERBOOKUPDATE']._serialized_end=2189 + _globals['_ORDERBOOK']._serialized_start=2192 + _globals['_ORDERBOOK']._serialized_end=2356 + _globals['_BANKBALANCE']._serialized_start=2359 + _globals['_BANKBALANCE']._serialized_end=2503 + _globals['_SUBACCOUNTDEPOSITS']._serialized_start=2506 + _globals['_SUBACCOUNTDEPOSITS']._serialized_end=2637 + _globals['_SUBACCOUNTDEPOSIT']._serialized_start=2639 + _globals['_SUBACCOUNTDEPOSIT']._serialized_end=2744 + _globals['_SPOTORDERUPDATE']._serialized_start=2747 + _globals['_SPOTORDERUPDATE']._serialized_end=2931 + _globals['_SPOTORDER']._serialized_start=2933 + _globals['_SPOTORDER']._serialized_end=3040 + _globals['_DERIVATIVEORDERUPDATE']._serialized_start=3043 + _globals['_DERIVATIVEORDERUPDATE']._serialized_end=3239 + _globals['_DERIVATIVEORDER']._serialized_start=3242 + _globals['_DERIVATIVEORDER']._serialized_end=3390 + _globals['_POSITION']._serialized_start=3393 + _globals['_POSITION']._serialized_end=3784 + _globals['_ORACLEPRICE']._serialized_start=3786 + _globals['_ORACLEPRICE']._serialized_end=3902 + _globals['_SPOTTRADE']._serialized_start=3905 + _globals['_SPOTTRADE']._serialized_end=4356 + _globals['_DERIVATIVETRADE']._serialized_start=4359 + _globals['_DERIVATIVETRADE']._serialized_end=4830 + _globals['_TRADESFILTER']._serialized_start=4832 + _globals['_TRADESFILTER']._serialized_end=4916 + _globals['_POSITIONSFILTER']._serialized_start=4918 + _globals['_POSITIONSFILTER']._serialized_end=5005 + _globals['_ORDERSFILTER']._serialized_start=5007 + _globals['_ORDERSFILTER']._serialized_end=5091 + _globals['_ORDERBOOKFILTER']._serialized_start=5093 + _globals['_ORDERBOOKFILTER']._serialized_end=5141 + _globals['_BANKBALANCESFILTER']._serialized_start=5143 + _globals['_BANKBALANCESFILTER']._serialized_end=5191 + _globals['_SUBACCOUNTDEPOSITSFILTER']._serialized_start=5193 + _globals['_SUBACCOUNTDEPOSITSFILTER']._serialized_end=5258 + _globals['_ORACLEPRICEFILTER']._serialized_start=5260 + _globals['_ORACLEPRICEFILTER']._serialized_end=5303 + _globals['_STREAM']._serialized_start=5383 + _globals['_STREAM']._serialized_end=5478 +# @@protoc_insertion_point(module_scope) diff --git a/pyinjective/proto/injective/stream/v2/query_pb2_grpc.py b/pyinjective/proto/injective/stream/v2/query_pb2_grpc.py new file mode 100644 index 00000000..ebb3b134 --- /dev/null +++ b/pyinjective/proto/injective/stream/v2/query_pb2_grpc.py @@ -0,0 +1,80 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from pyinjective.proto.injective.stream.v2 import query_pb2 as injective_dot_stream_dot_v2_dot_query__pb2 + + +class StreamStub(object): + """ChainStream defines the gRPC streaming service. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.StreamV2 = channel.unary_stream( + '/injective.stream.v2.Stream/StreamV2', + request_serializer=injective_dot_stream_dot_v2_dot_query__pb2.StreamRequest.SerializeToString, + response_deserializer=injective_dot_stream_dot_v2_dot_query__pb2.StreamResponse.FromString, + _registered_method=True) + + +class StreamServicer(object): + """ChainStream defines the gRPC streaming service. + """ + + def StreamV2(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_StreamServicer_to_server(servicer, server): + rpc_method_handlers = { + 'StreamV2': grpc.unary_stream_rpc_method_handler( + servicer.StreamV2, + request_deserializer=injective_dot_stream_dot_v2_dot_query__pb2.StreamRequest.FromString, + response_serializer=injective_dot_stream_dot_v2_dot_query__pb2.StreamResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'injective.stream.v2.Stream', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('injective.stream.v2.Stream', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class Stream(object): + """ChainStream defines the gRPC streaming service. + """ + + @staticmethod + def StreamV2(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream( + request, + target, + '/injective.stream.v2.Stream/StreamV2', + injective_dot_stream_dot_v2_dot_query__pb2.StreamRequest.SerializeToString, + injective_dot_stream_dot_v2_dot_query__pb2.StreamResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/tests/client/chain/stream_grpc/configurable_chain_stream_query_servicer.py b/tests/client/chain/stream_grpc/configurable_chain_stream_query_servicer.py index 8e7a5963..943b91c0 100644 --- a/tests/client/chain/stream_grpc/configurable_chain_stream_query_servicer.py +++ b/tests/client/chain/stream_grpc/configurable_chain_stream_query_servicer.py @@ -1,6 +1,10 @@ from collections import deque from pyinjective.proto.injective.stream.v1beta1 import query_pb2 as chain_stream_pb, query_pb2_grpc as chain_stream_grpc +from pyinjective.proto.injective.stream.v2 import ( + query_pb2 as chain_stream_v2_pb, + query_pb2_grpc as chain_stream_v2_grpc, +) class ConfigurableChainStreamQueryServicer(chain_stream_grpc.StreamServicer): @@ -12,3 +16,13 @@ def __init__(self): async def Stream(self, request: chain_stream_pb.StreamRequest, context=None, metadata=None): for event in self.stream_responses: yield event + + +class ConfigurableChainStreamV2QueryServicer(chain_stream_v2_grpc.StreamServicer): + def __init__(self): + super().__init__() + self.stream_responses = deque() + + async def StreamV2(self, request: chain_stream_v2_pb.StreamRequest, context=None, metadata=None): + for event in self.stream_responses: + yield event diff --git a/tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py b/tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py index da22aec1..53f9cd66 100644 --- a/tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py +++ b/tests/client/chain/stream_grpc/test_chain_grpc_chain_stream.py @@ -8,9 +8,14 @@ from pyinjective.composer import Composer from pyinjective.core.network import DisabledCookieAssistant, Network from pyinjective.proto.cosmos.base.v1beta1 import coin_pb2 as coin_pb +from pyinjective.proto.injective.exchange.v1beta1 import exchange_pb2 as exchange_pb from pyinjective.proto.injective.exchange.v2 import exchange_pb2 as exchange_v2_pb, order_pb2 as order_v2_pb from pyinjective.proto.injective.stream.v1beta1 import query_pb2 as chain_stream_pb -from tests.client.chain.stream_grpc.configurable_chain_stream_query_servicer import ConfigurableChainStreamQueryServicer +from pyinjective.proto.injective.stream.v2 import query_pb2 as chain_stream_v2_pb +from tests.client.chain.stream_grpc.configurable_chain_stream_query_servicer import ( + ConfigurableChainStreamQueryServicer, + ConfigurableChainStreamV2QueryServicer, +) @pytest.fixture @@ -18,11 +23,17 @@ def chain_stream_servicer(): return ConfigurableChainStreamQueryServicer() +@pytest.fixture +def chain_stream_v2_servicer(): + return ConfigurableChainStreamV2QueryServicer() + + class TestChainGrpcChainStream: @pytest.mark.asyncio async def test_stream( self, chain_stream_servicer, + chain_stream_v2_servicer, ): block_height = 19114391 block_time = 1701457189786 @@ -34,7 +45,7 @@ async def test_stream( account="inj1qaq7mkvuc474k2nyjm2suwyes06fdm4kt26ks4", balances=[balance_coin], ) - deposit = exchange_v2_pb.Deposit( + deposit = exchange_pb.Deposit( available_balance="112292968420000000000000", total_balance="73684013968420000000000000", ) @@ -59,7 +70,7 @@ async def test_stream( cid="HBOTSIJUT60b77b9c56f0456af96c5c6c0d8", trade_id=f"{block_height}_0", ) - position_delta = exchange_v2_pb.PositionDelta( + position_delta = exchange_pb.PositionDelta( is_long=True, execution_quantity="5000000", execution_price="13945600", @@ -78,16 +89,16 @@ async def test_stream( cid="cid1", trade_id=f"{block_height}_1", ) - spot_order_info = order_v2_pb.OrderInfo( + spot_order_info = exchange_pb.OrderInfo( subaccount_id="0x5e249f0e8cb406f41de16e1bd6f6b55e7bc75add000000000000000000000004", fee_recipient="inj1tcjf7r5vksr0g80pdcdada44teauwkkahelyfy", price="18775000", quantity="54606542000000000000000000000000000000000", cid="cid2", ) - spot_limit_order = order_v2_pb.SpotLimitOrder( + spot_limit_order = exchange_pb.SpotLimitOrder( order_info=spot_order_info, - order_type=order_v2_pb.OrderType.SELL_PO, + order_type=exchange_pb.OrderType.SELL_PO, fillable="54606542000000000000000000000000000000000", trigger_price="", order_hash=( @@ -104,16 +115,16 @@ async def test_stream( cid="cid2", order=spot_order, ) - derivative_order_info = order_v2_pb.OrderInfo( + derivative_order_info = exchange_pb.OrderInfo( subaccount_id="0x5e249f0e8cb406f41de16e1bd6f6b55e7bc75add000000000000000000000004", fee_recipient="inj1tcjf7r5vksr0g80pdcdada44teauwkkahelyfy", price="18775000", quantity="54606542000000000000000000000000000000000", cid="cid2", ) - derivative_limit_order = order_v2_pb.DerivativeLimitOrder( + derivative_limit_order = exchange_pb.DerivativeLimitOrder( order_info=derivative_order_info, - order_type=order_v2_pb.OrderType.SELL_PO, + order_type=exchange_pb.OrderType.SELL_PO, margin="54606542000000000000000000000000000000000", fillable="54606542000000000000000000000000000000000", trigger_price="", @@ -130,8 +141,8 @@ async def test_stream( cid="cid3", order=derivative_order, ) - spot_buy_level = exchange_v2_pb.Level(p="17280000", q="44557734000000000000000000000000000000000") - spot_sell_level = exchange_v2_pb.Level( + spot_buy_level = exchange_pb.Level(p="17280000", q="44557734000000000000000000000000000000000") + spot_sell_level = exchange_pb.Level( p="18207000", q="22196395000000000000000000000000000000000", ) @@ -144,8 +155,8 @@ async def test_stream( seq=6645013, orderbook=spot_orderbook, ) - derivative_buy_level = exchange_v2_pb.Level(p="17280000", q="44557734000000000000000000000000000000000") - derivative_sell_level = exchange_v2_pb.Level( + derivative_buy_level = exchange_pb.Level(p="17280000", q="44557734000000000000000000000000000000000") + derivative_sell_level = exchange_pb.Level( p="18207000", q="22196395000000000000000000000000000000000", ) @@ -192,7 +203,7 @@ async def test_stream( network = Network.devnet() composer = Composer(network=network.string()) - api = self._api_instance(servicer=chain_stream_servicer) + api = self._api_instance(servicer=chain_stream_servicer, servicer_v2=chain_stream_v2_servicer) events = asyncio.Queue() end_event = asyncio.Event() @@ -403,12 +414,398 @@ async def test_stream( assert first_update == expected_update assert end_event.is_set() - def _api_instance(self, servicer): + @pytest.mark.asyncio + async def test_stream_v2( + self, + chain_stream_servicer, + chain_stream_v2_servicer, + ): + block_height = 19114391 + block_time = 1701457189786 + balance_coin = coin_pb.Coin( + denom="inj", + amount="6941221373191000000000", + ) + bank_balance = chain_stream_v2_pb.BankBalance( + account="inj1qaq7mkvuc474k2nyjm2suwyes06fdm4kt26ks4", + balances=[balance_coin], + ) + deposit = exchange_v2_pb.Deposit( + available_balance="112292968420000000000000", + total_balance="73684013968420000000000000", + ) + subaccount_deposit = chain_stream_v2_pb.SubaccountDeposit( + denom="peggy0x87aB3B4C8661e07D6372361211B96ed4Dc36B1B5", + deposit=deposit, + ) + subaccount_deposits = chain_stream_v2_pb.SubaccountDeposits( + subaccount_id="0x5e249f0e8cb406f41de16e1bd6f6b55e7bc75add000000000000000000000007", + deposits=[subaccount_deposit], + ) + spot_trade = chain_stream_v2_pb.SpotTrade( + market_id="0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe", + is_buy=False, + executionType="LimitMatchNewOrder", + quantity="70", + price="18.215", + subaccount_id="0x893f2abf8034627e50cbc63923120b1122503ce0000000000000000000000001", + fee="7.6503", + order_hash="0xce0d9b701f77cd6ddfda5dd3a4fe7b2d53ba83e5d6c054fb2e9e886200b7b7bb", + fee_recipient_address="inj13ylj40uqx338u5xtccujxystzy39q08q2gz3dx", + cid="HBOTSIJUT60b77b9c56f0456af96c5c6c0d8", + trade_id=f"{block_height}_0", + ) + position_delta = exchange_v2_pb.PositionDelta( + is_long=True, + execution_quantity="5", + execution_price="13.9456", + execution_margin="69.728", + ) + derivative_trade = chain_stream_v2_pb.DerivativeTrade( + market_id="0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6", + is_buy=False, + executionType="LimitMatchNewOrder", + subaccount_id="0xc7dca7c15c364865f77a4fb67ab11dc95502e6fe000000000000000000000001", + position_delta=position_delta, + payout="0", + fee="7.6503", + order_hash="0xe549e4750287c93fcc8dec24f319c15025e07e89a8d0937be2b3865ed79d9da7", + fee_recipient_address="inj1clw20s2uxeyxtam6f7m84vgae92s9eh7vygagt", + cid="cid1", + trade_id=f"{block_height}_1", + ) + spot_order_info = order_v2_pb.OrderInfo( + subaccount_id="0x5e249f0e8cb406f41de16e1bd6f6b55e7bc75add000000000000000000000004", + fee_recipient="inj1tcjf7r5vksr0g80pdcdada44teauwkkahelyfy", + price="18.775", + quantity="54.606542", + cid="cid2", + ) + spot_limit_order = order_v2_pb.SpotLimitOrder( + order_info=spot_order_info, + order_type=order_v2_pb.OrderType.SELL_PO, + fillable="54.606542", + trigger_price="", + order_hash=( + b"\xf9\xc7\xd8v8\x84-\x9b\x99s\xf5\xdfX\xc9\xf9V\x9a\xf7\xf9\xc3\xa1\x00h\t\xc17<\xd1k\x9d\x12\xed" + ), + ) + spot_order = chain_stream_v2_pb.SpotOrder( + market_id="0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe", + order=spot_limit_order, + ) + spot_order_update = chain_stream_v2_pb.SpotOrderUpdate( + status="Booked", + order_hash="0x7ee76255d7ca763c56b0eab9828fca89fdd3739645501c8a80f58b62b4f76da5", + cid="cid2", + order=spot_order, + ) + derivative_order_info = order_v2_pb.OrderInfo( + subaccount_id="0x5e249f0e8cb406f41de16e1bd6f6b55e7bc75add000000000000000000000004", + fee_recipient="inj1tcjf7r5vksr0g80pdcdada44teauwkkahelyfy", + price="18.775", + quantity="54.606542", + cid="cid2", + ) + derivative_limit_order = order_v2_pb.DerivativeLimitOrder( + order_info=derivative_order_info, + order_type=order_v2_pb.OrderType.SELL_PO, + margin="546.06542", + fillable="54.606542", + trigger_price="", + order_hash=b"\x03\xc9\xf8G*Q-G%\xf1\xbcF3\xe89g\xbe\xeag\xd8Y\x7f\x87\x8a\xa5\xac\x8ew\x8a\x91\xa2F", + ) + derivative_order = chain_stream_v2_pb.DerivativeOrder( + market_id="0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6", + order=derivative_limit_order, + is_market=False, + ) + derivative_order_update = chain_stream_v2_pb.DerivativeOrderUpdate( + status="Booked", + order_hash="0x48690013c382d5dbaff9989db04629a16a5818d7524e027d517ccc89fd068103", + cid="cid3", + order=derivative_order, + ) + spot_buy_level = exchange_v2_pb.Level(p="17.28", q="445577.34") + spot_sell_level = exchange_v2_pb.Level( + p="18.207", + q="221963.95", + ) + spot_orderbook = chain_stream_v2_pb.Orderbook( + market_id="0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe", + buy_levels=[spot_buy_level], + sell_levels=[spot_sell_level], + ) + spot_orderbook_update = chain_stream_v2_pb.OrderbookUpdate( + seq=6645013, + orderbook=spot_orderbook, + ) + derivative_buy_level = exchange_v2_pb.Level(p="17.28", q="445577.34") + derivative_sell_level = exchange_v2_pb.Level( + p="18.207", + q="221963.95", + ) + derivative_orderbook = chain_stream_v2_pb.Orderbook( + market_id="0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6", + buy_levels=[derivative_buy_level], + sell_levels=[derivative_sell_level], + ) + derivative_orderbook_update = chain_stream_v2_pb.OrderbookUpdate( + seq=6645013, + orderbook=derivative_orderbook, + ) + position = chain_stream_v2_pb.Position( + market_id="0x17ef48032cb24375ba7c2e39f384e56433bcab20cbee9a7357e4cba2eb00abe6", + subaccount_id="0x5e249f0e8cb406f41de16e1bd6f6b55e7bc75add000000000000000000000004", + isLong=True, + quantity="221.96395", + entry_price="18.207", + margin="2219.6395", + cumulative_funding_entry="0", + ) + oracle_price = chain_stream_v2_pb.OraclePrice( + symbol="0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722", + price="99.991086", + type="pyth", + ) + + chain_stream_v2_servicer.stream_responses.append( + chain_stream_v2_pb.StreamResponse( + block_height=block_height, + block_time=block_time, + bank_balances=[bank_balance], + subaccount_deposits=[subaccount_deposits], + spot_trades=[spot_trade], + derivative_trades=[derivative_trade], + spot_orders=[spot_order_update], + derivative_orders=[derivative_order_update], + spot_orderbook_updates=[spot_orderbook_update], + derivative_orderbook_updates=[derivative_orderbook_update], + positions=[position], + oracle_prices=[oracle_price], + ) + ) + + network = Network.devnet() + composer = Composer(network=network.string()) + api = self._api_instance(servicer=chain_stream_servicer, servicer_v2=chain_stream_v2_servicer) + + events = asyncio.Queue() + end_event = asyncio.Event() + + callback = lambda update: events.put_nowait(update) + error_callback = lambda exception: pytest.fail(str(exception)) + end_callback = lambda: end_event.set() + + bank_balances_filter = composer.chain_stream_bank_balances_v2_filter() + subaccount_deposits_filter = composer.chain_stream_subaccount_deposits_v2_filter() + spot_trades_filter = composer.chain_stream_trades_v2_filter() + derivative_trades_filter = composer.chain_stream_trades_v2_filter() + spot_orders_filter = composer.chain_stream_orders_v2_filter() + derivative_orders_filter = composer.chain_stream_orders_v2_filter() + spot_orderbooks_filter = composer.chain_stream_orderbooks_v2_filter() + derivative_orderbooks_filter = composer.chain_stream_orderbooks_v2_filter() + positions_filter = composer.chain_stream_positions_v2_filter() + oracle_price_filter = composer.chain_stream_oracle_price_v2_filter() + + expected_update = { + "blockHeight": str(block_height), + "blockTime": str(block_time), + "bankBalances": [ + { + "account": bank_balance.account, + "balances": [ + { + "denom": balance_coin.denom, + "amount": balance_coin.amount, + } + ], + }, + ], + "subaccountDeposits": [ + { + "subaccountId": subaccount_deposits.subaccount_id, + "deposits": [ + { + "denom": subaccount_deposit.denom, + "deposit": { + "availableBalance": deposit.available_balance, + "totalBalance": deposit.total_balance, + }, + } + ], + } + ], + "spotTrades": [ + { + "marketId": spot_trade.market_id, + "isBuy": spot_trade.is_buy, + "executionType": spot_trade.executionType, + "quantity": spot_trade.quantity, + "price": spot_trade.price, + "subaccountId": spot_trade.subaccount_id, + "fee": spot_trade.fee, + "orderHash": spot_trade.order_hash, + "feeRecipientAddress": spot_trade.fee_recipient_address, + "cid": spot_trade.cid, + "tradeId": spot_trade.trade_id, + }, + ], + "derivativeTrades": [ + { + "marketId": derivative_trade.market_id, + "isBuy": derivative_trade.is_buy, + "executionType": derivative_trade.executionType, + "subaccountId": derivative_trade.subaccount_id, + "positionDelta": { + "isLong": position_delta.is_long, + "executionMargin": position_delta.execution_margin, + "executionQuantity": position_delta.execution_quantity, + "executionPrice": position_delta.execution_price, + }, + "payout": derivative_trade.payout, + "fee": derivative_trade.fee, + "orderHash": derivative_trade.order_hash, + "feeRecipientAddress": derivative_trade.fee_recipient_address, + "cid": derivative_trade.cid, + "tradeId": derivative_trade.trade_id, + } + ], + "spotOrders": [ + { + "status": "Booked", + "orderHash": spot_order_update.order_hash, + "cid": spot_order_update.cid, + "order": { + "marketId": spot_order.market_id, + "order": { + "orderInfo": { + "subaccountId": spot_order_info.subaccount_id, + "feeRecipient": spot_order_info.fee_recipient, + "price": spot_order_info.price, + "quantity": spot_order_info.quantity, + "cid": spot_order_info.cid, + }, + "orderType": "SELL_PO", + "fillable": spot_limit_order.fillable, + "triggerPrice": spot_limit_order.trigger_price, + "orderHash": base64.b64encode(spot_limit_order.order_hash).decode(), + }, + }, + }, + ], + "derivativeOrders": [ + { + "status": "Booked", + "orderHash": derivative_order_update.order_hash, + "cid": derivative_order_update.cid, + "order": { + "marketId": derivative_order.market_id, + "order": { + "orderInfo": { + "subaccountId": derivative_order_info.subaccount_id, + "feeRecipient": derivative_order_info.fee_recipient, + "price": derivative_order_info.price, + "quantity": derivative_order_info.quantity, + "cid": derivative_order_info.cid, + }, + "orderType": "SELL_PO", + "margin": derivative_limit_order.margin, + "fillable": derivative_limit_order.fillable, + "triggerPrice": derivative_limit_order.trigger_price, + "orderHash": base64.b64encode(derivative_limit_order.order_hash).decode(), + }, + "isMarket": derivative_order.is_market, + }, + }, + ], + "spotOrderbookUpdates": [ + { + "seq": str(spot_orderbook_update.seq), + "orderbook": { + "marketId": spot_orderbook.market_id, + "buyLevels": [ + { + "p": spot_buy_level.p, + "q": spot_buy_level.q, + }, + ], + "sellLevels": [ + {"p": spot_sell_level.p, "q": spot_sell_level.q}, + ], + }, + }, + ], + "derivativeOrderbookUpdates": [ + { + "seq": str(derivative_orderbook_update.seq), + "orderbook": { + "marketId": derivative_orderbook.market_id, + "buyLevels": [ + { + "p": derivative_buy_level.p, + "q": derivative_buy_level.q, + }, + ], + "sellLevels": [ + { + "p": derivative_sell_level.p, + "q": derivative_sell_level.q, + }, + ], + }, + }, + ], + "positions": [ + { + "marketId": position.market_id, + "subaccountId": position.subaccount_id, + "isLong": position.isLong, + "quantity": position.quantity, + "entryPrice": position.entry_price, + "margin": position.margin, + "cumulativeFundingEntry": position.cumulative_funding_entry, + } + ], + "oraclePrices": [ + { + "symbol": oracle_price.symbol, + "price": oracle_price.price, + "type": oracle_price.type, + }, + ], + } + + asyncio.get_event_loop().create_task( + api.stream_v2( + callback=callback, + on_end_callback=end_callback, + on_status_callback=error_callback, + bank_balances_filter=bank_balances_filter, + subaccount_deposits_filter=subaccount_deposits_filter, + spot_trades_filter=spot_trades_filter, + derivative_trades_filter=derivative_trades_filter, + spot_orders_filter=spot_orders_filter, + derivative_orders_filter=derivative_orders_filter, + spot_orderbooks_filter=spot_orderbooks_filter, + derivative_orderbooks_filter=derivative_orderbooks_filter, + positions_filter=positions_filter, + oracle_price_filter=oracle_price_filter, + ) + ) + + first_update = await asyncio.wait_for(events.get(), timeout=1) + + assert first_update == expected_update + assert end_event.is_set() + + def _api_instance(self, servicer, servicer_v2): network = Network.devnet() channel = grpc.aio.insecure_channel(network.grpc_endpoint) cookie_assistant = DisabledCookieAssistant() api = ChainGrpcChainStream(channel=channel, cookie_assistant=cookie_assistant) api._stub = servicer + api._stub_v2 = servicer_v2 return api diff --git a/tests/test_async_client_deprecation_warnings.py b/tests/test_async_client_deprecation_warnings.py index 04900871..425a60b9 100644 --- a/tests/test_async_client_deprecation_warnings.py +++ b/tests/test_async_client_deprecation_warnings.py @@ -5,6 +5,7 @@ from pyinjective.async_client import AsyncClient from pyinjective.core.network import Network from pyinjective.proto.injective.exchange.v1beta1 import query_pb2 as exchange_query_pb +from pyinjective.proto.injective.stream.v1beta1 import query_pb2 as chain_stream_pb from tests.client.chain.grpc.configurable_exchange_query_servicer import ConfigurableExchangeQueryServicer from tests.client.chain.stream_grpc.configurable_chain_stream_query_servicer import ConfigurableChainStreamQueryServicer @@ -20,6 +21,30 @@ def exchange_servicer(): class TestAsyncClientDeprecationWarnings: + @pytest.mark.asyncio + async def test_listen_chain_stream_updates_deprecation_warning( + self, + chain_stream_servicer, + ): + async def callback(event): + pass + + client = AsyncClient( + network=Network.local(), + ) + client.chain_stream_api._stub = chain_stream_servicer + chain_stream_servicer.stream_responses.append(chain_stream_pb.StreamResponse()) + + with catch_warnings(record=True) as all_warnings: + await client.listen_chain_stream_updates(callback=callback) + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use listen_chain_stream_v2_updates instead" + ) + @pytest.mark.asyncio async def test_fetch_aggregate_volume_deprecation_warning( self, diff --git a/tests/test_composer_deprecation_warnings.py b/tests/test_composer_deprecation_warnings.py index 48ff32d1..a0bee361 100644 --- a/tests/test_composer_deprecation_warnings.py +++ b/tests/test_composer_deprecation_warnings.py @@ -33,6 +33,97 @@ def basic_composer(self, inj_usdt_spot_market, btc_usdt_perp_market, first_match return composer + def test_chain_stream_bank_balances_filter_deprecation_warning(self): + composer = Composer(network=Network.devnet().string()) + + with warnings.catch_warnings(record=True) as all_warnings: + composer.chain_stream_bank_balances_filter(accounts=["account"]) + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use chain_stream_bank_balances_v2_filter instead" + ) + + def test_chain_stream_subaccount_deposits_filter_deprecation_warning(self): + composer = Composer(network=Network.devnet().string()) + + with warnings.catch_warnings(record=True) as all_warnings: + composer.chain_stream_subaccount_deposits_filter() + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use chain_stream_subaccount_deposits_v2_filter instead" + ) + + def test_chain_stream_trades_filter_deprecation_warning(self): + composer = Composer(network=Network.devnet().string()) + + with warnings.catch_warnings(record=True) as all_warnings: + composer.chain_stream_trades_filter() + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use chain_stream_trades_v2_filter instead" + ) + + def test_chain_stream_orders_filter_deprecation_warning(self): + composer = Composer(network=Network.devnet().string()) + + with warnings.catch_warnings(record=True) as all_warnings: + composer.chain_stream_orders_filter() + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use chain_stream_orders_v2_filter instead" + ) + + def test_chain_stream_orderbooks_filter_deprecation_warning(self): + composer = Composer(network=Network.devnet().string()) + + with warnings.catch_warnings(record=True) as all_warnings: + composer.chain_stream_orderbooks_filter() + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use chain_stream_orderbooks_v2_filter instead" + ) + + def test_chain_stream_positions_filter_deprecation_warning(self): + composer = Composer(network=Network.devnet().string()) + + with warnings.catch_warnings(record=True) as all_warnings: + composer.chain_stream_positions_filter() + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use chain_stream_positions_v2_filter instead" + ) + + def test_chain_stream_oracle_price_filter_deprecation_warning(self): + composer = Composer(network=Network.devnet().string()) + + with warnings.catch_warnings(record=True) as all_warnings: + composer.chain_stream_oracle_price_filter() + + deprecation_warnings = [warning for warning in all_warnings if issubclass(warning.category, DeprecationWarning)] + assert len(deprecation_warnings) == 1 + assert ( + str(deprecation_warnings[0].message) + == "This method is deprecated. Use chain_stream_oracle_price_v2_filter instead" + ) + def test_msg_grant_typed_deprecation_warning(self): composer = Composer(network=Network.devnet().string())