meshtrade 1.0.1__py3-none-any.whl → 1.29.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meshtrade/common/__init__.py +2 -4
- meshtrade/common/config.py +3 -4
- meshtrade/common/grpc_client.py +140 -0
- meshtrade/common/service_options.py +46 -0
- meshtrade/compliance/client/v1/__init__.py +0 -2
- meshtrade/compliance/client/v1/client_pb2.py +15 -4
- meshtrade/compliance/client/v1/client_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/company_pb2.py +25 -8
- meshtrade/compliance/client/v1/company_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/company_representative_pb2.py +9 -4
- meshtrade/compliance/client/v1/company_representative_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/company_representative_role_pb2.py +2 -2
- meshtrade/compliance/client/v1/fund_pb2.py +13 -4
- meshtrade/compliance/client/v1/fund_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/identification_document_type_pb2.py +2 -2
- meshtrade/compliance/client/v1/industry_classification_pb2.py +2 -2
- meshtrade/compliance/client/v1/natural_person_connection_type_pb2.py +2 -2
- meshtrade/compliance/client/v1/natural_person_pb2.py +19 -4
- meshtrade/compliance/client/v1/natural_person_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/pep_status_pb2.py +2 -2
- meshtrade/compliance/client/v1/service_meshpy.py +2 -1
- meshtrade/compliance/client/v1/service_pb2.py +21 -17
- meshtrade/compliance/client/v1/service_pb2.pyi +2 -2
- meshtrade/compliance/client/v1/source_of_income_and_wealth_pb2.py +2 -2
- meshtrade/compliance/client/v1/tax_residency_pb2.py +9 -4
- meshtrade/compliance/client/v1/tax_residency_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/trust_pb2.py +13 -4
- meshtrade/compliance/client/v1/trust_pb2.pyi +1 -0
- meshtrade/compliance/client/v1/verification_status_pb2.py +2 -2
- meshtrade/iam/api_user/v1/__init__.py +34 -26
- meshtrade/iam/api_user/v1/api_credentials_pb2.py +5 -5
- meshtrade/iam/api_user/v1/api_user_pb2.py +13 -9
- meshtrade/iam/api_user/v1/api_user_pb2.pyi +2 -4
- meshtrade/iam/api_user/v1/api_user_state_machine.py +104 -0
- meshtrade/iam/api_user/v1/service_meshpy.py +96 -61
- meshtrade/iam/api_user/v1/service_pb2.py +61 -40
- meshtrade/iam/api_user/v1/service_pb2.pyi +26 -11
- meshtrade/iam/api_user/v1/service_pb2_grpc.py +179 -135
- meshtrade/iam/group/v1/__init__.py +4 -2
- meshtrade/iam/group/v1/group_pb2.py +13 -4
- meshtrade/iam/group/v1/group_pb2.pyi +9 -2
- meshtrade/iam/group/v1/service_meshpy.py +41 -6
- meshtrade/iam/group/v1/service_pb2.py +47 -20
- meshtrade/iam/group/v1/service_pb2.pyi +46 -13
- meshtrade/iam/group/v1/service_pb2_grpc.py +151 -16
- meshtrade/iam/role/v1/__init__.py +17 -4
- meshtrade/iam/role/v1/role.py +162 -11
- meshtrade/iam/role/v1/role_pb2.py +4 -7
- meshtrade/iam/role/v1/role_pb2.pyi +53 -23
- meshtrade/iam/user/v1/__init__.py +22 -4
- meshtrade/iam/user/v1/service_meshpy.py +129 -7
- meshtrade/iam/user/v1/service_pb2.py +66 -16
- meshtrade/iam/user/v1/service_pb2.pyi +81 -9
- meshtrade/iam/user/v1/service_pb2_grpc.py +385 -14
- meshtrade/iam/user/v1/user_pb2.py +13 -4
- meshtrade/iam/user/v1/user_pb2.pyi +7 -2
- meshtrade/ledger/transaction/v1/__init__.py +25 -1
- meshtrade/ledger/transaction/v1/service_meshpy.py +176 -0
- meshtrade/ledger/transaction/v1/service_pb2.py +56 -0
- meshtrade/ledger/transaction/v1/service_pb2.pyi +32 -0
- meshtrade/ledger/transaction/v1/service_pb2_grpc.py +131 -0
- meshtrade/ledger/transaction/v1/transaction_action_pb2.py +2 -2
- meshtrade/ledger/transaction/v1/transaction_state_machine.py +75 -0
- meshtrade/ledger/transaction/v1/transaction_state_pb2.py +2 -2
- meshtrade/{reporting/income_report → market_data/price}/v1/__init__.py +11 -20
- meshtrade/market_data/price/v1/price_pb2.py +40 -0
- meshtrade/market_data/price/v1/price_pb2.pyi +23 -0
- meshtrade/market_data/price/v1/service_meshpy.py +152 -0
- meshtrade/market_data/price/v1/service_pb2.py +49 -0
- meshtrade/market_data/price/v1/service_pb2.pyi +18 -0
- meshtrade/market_data/price/v1/service_pb2_grpc.py +84 -0
- meshtrade/option/method_options/v1/__init__.py +41 -0
- meshtrade/option/method_options/v1/method_options_pb2.py +43 -0
- meshtrade/option/method_options/v1/method_options_pb2.pyi +40 -0
- meshtrade/reporting/account_report/v1/__init__.py +66 -0
- meshtrade/reporting/account_report/v1/account_report_pb2.py +46 -0
- meshtrade/reporting/account_report/v1/account_report_pb2.pyi +49 -0
- meshtrade/reporting/{income_report → account_report}/v1/disclaimer_pb2.py +7 -7
- meshtrade/reporting/account_report/v1/fee_entry_pb2.py +39 -0
- meshtrade/reporting/account_report/v1/fee_entry_pb2.pyi +26 -0
- meshtrade/reporting/account_report/v1/fee_entry_pb2_grpc.py +4 -0
- meshtrade/reporting/account_report/v1/income_entry.py +35 -0
- meshtrade/reporting/account_report/v1/income_entry_pb2.py +42 -0
- meshtrade/reporting/{income_report/v1/entry_pb2.pyi → account_report/v1/income_entry_pb2.pyi} +18 -10
- meshtrade/reporting/account_report/v1/income_entry_pb2_grpc.py +4 -0
- meshtrade/reporting/{income_report → account_report}/v1/service_meshpy.py +37 -36
- meshtrade/reporting/account_report/v1/service_pb2.py +72 -0
- meshtrade/reporting/account_report/v1/service_pb2.pyi +43 -0
- meshtrade/reporting/account_report/v1/service_pb2_grpc.py +161 -0
- meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.py +39 -0
- meshtrade/reporting/account_report/v1/trading_statement_entry_pb2.pyi +30 -0
- meshtrade/reporting/account_report/v1/trading_statement_entry_pb2_grpc.py +4 -0
- meshtrade/studio/instrument/v1/__init__.py +43 -0
- meshtrade/studio/instrument/v1/instrument_pb2.py +45 -0
- meshtrade/studio/instrument/v1/instrument_pb2.pyi +20 -0
- meshtrade/studio/instrument/v1/instrument_pb2_grpc.py +4 -0
- meshtrade/studio/instrument/v1/instrument_type_pb2.py +37 -0
- meshtrade/studio/instrument/v1/instrument_type_pb2.pyi +64 -0
- meshtrade/studio/instrument/v1/instrument_type_pb2_grpc.py +4 -0
- meshtrade/studio/instrument/v1/unit_pb2.py +37 -0
- meshtrade/studio/instrument/v1/unit_pb2.pyi +46 -0
- meshtrade/studio/instrument/v1/unit_pb2_grpc.py +4 -0
- meshtrade/trading/limit_order/v1/__init__.py +22 -4
- meshtrade/trading/limit_order/v1/limit_order_pb2.py +24 -4
- meshtrade/trading/limit_order/v1/limit_order_pb2.pyi +55 -5
- meshtrade/trading/limit_order/v1/service_meshpy.py +113 -2
- meshtrade/trading/limit_order/v1/service_pb2.py +49 -9
- meshtrade/trading/limit_order/v1/service_pb2.pyi +67 -7
- meshtrade/trading/limit_order/v1/service_pb2_grpc.py +321 -4
- meshtrade/trading/market_order/v1/__init__.py +0 -2
- meshtrade/trading/market_order/v1/market_order_pb2.py +2 -2
- meshtrade/trading/market_order/v1/service_meshpy.py +3 -2
- meshtrade/trading/market_order/v1/service_pb2.py +8 -9
- meshtrade/trading/market_order/v1/service_pb2.pyi +1 -2
- meshtrade/type/v1/__init__.py +82 -12
- meshtrade/type/v1/address_pb2.py +2 -2
- meshtrade/type/v1/amount.py +429 -5
- meshtrade/type/v1/amount_pb2.py +2 -2
- meshtrade/type/v1/contact_details_pb2.py +2 -2
- meshtrade/type/v1/date_pb2.py +2 -2
- meshtrade/type/v1/decimal_built_in_conversions.py +8 -3
- meshtrade/type/v1/decimal_operations.py +354 -0
- meshtrade/type/v1/decimal_pb2.py +2 -2
- meshtrade/type/v1/ledger.py +76 -1
- meshtrade/type/v1/ledger_pb2.py +2 -2
- meshtrade/type/v1/sorting_pb2.py +2 -2
- meshtrade/type/v1/time_of_day_pb2.py +2 -2
- meshtrade/type/v1/token.py +144 -0
- meshtrade/type/v1/token_pb2.py +2 -2
- meshtrade/wallet/account/v1/__init__.py +21 -3
- meshtrade/wallet/account/v1/account_pb2.py +28 -4
- meshtrade/wallet/account/v1/account_pb2.pyi +57 -3
- meshtrade/wallet/account/v1/service_meshpy.py +72 -1
- meshtrade/wallet/account/v1/service_pb2.py +67 -23
- meshtrade/wallet/account/v1/service_pb2.pyi +81 -21
- meshtrade/wallet/account/v1/service_pb2_grpc.py +242 -8
- {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/METADATA +1 -1
- meshtrade-1.29.0.dist-info/RECORD +217 -0
- meshtrade/compliance/client/v1/service_options_meshpy.py +0 -65
- meshtrade/iam/api_user/v1/service.py +0 -58
- meshtrade/iam/api_user/v1/service_options_meshpy.py +0 -65
- meshtrade/iam/group/v1/service_options_meshpy.py +0 -65
- meshtrade/iam/user/v1/service_options_meshpy.py +0 -65
- meshtrade/option/v1/method_type_pb2.py +0 -38
- meshtrade/option/v1/method_type_pb2.pyi +0 -17
- meshtrade/reporting/income_report/v1/entry_pb2.py +0 -42
- meshtrade/reporting/income_report/v1/income_report_pb2.py +0 -44
- meshtrade/reporting/income_report/v1/income_report_pb2.pyi +0 -42
- meshtrade/reporting/income_report/v1/service_options_meshpy.py +0 -65
- meshtrade/reporting/income_report/v1/service_pb2.py +0 -58
- meshtrade/reporting/income_report/v1/service_pb2.pyi +0 -37
- meshtrade/reporting/income_report/v1/service_pb2_grpc.py +0 -170
- meshtrade/trading/limit_order/v1/service_options_meshpy.py +0 -65
- meshtrade/trading/market_order/v1/service_options_meshpy.py +0 -65
- meshtrade/wallet/account/v1/service_options_meshpy.py +0 -65
- meshtrade-1.0.1.dist-info/RECORD +0 -191
- /meshtrade/{option/v1/method_type_pb2_grpc.py → market_data/price/v1/price_pb2_grpc.py} +0 -0
- /meshtrade/{reporting/income_report/v1/disclaimer_pb2_grpc.py → option/method_options/v1/method_options_pb2_grpc.py} +0 -0
- /meshtrade/reporting/{income_report/v1/entry_pb2_grpc.py → account_report/v1/account_report_pb2_grpc.py} +0 -0
- /meshtrade/reporting/{income_report → account_report}/v1/disclaimer_pb2.pyi +0 -0
- /meshtrade/reporting/{income_report/v1/income_report_pb2_grpc.py → account_report/v1/disclaimer_pb2_grpc.py} +0 -0
- {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/WHEEL +0 -0
- {meshtrade-1.0.1.dist-info → meshtrade-1.29.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Code generated by protoc-gen-meshpy. DO NOT EDIT.
|
|
2
|
+
# source: meshtrade/ledger/transaction/v1/service.proto
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
TransactionService gRPC service wrapper with authentication, timeouts, and resource management.
|
|
6
|
+
|
|
7
|
+
This module provides a high-level gRPC service for the TransactionService service that combines
|
|
8
|
+
the service interface with resource management capabilities, providing authentication,
|
|
9
|
+
timeouts, and proper connection handling.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from collections.abc import Iterator
|
|
13
|
+
from datetime import timedelta
|
|
14
|
+
from typing import Optional
|
|
15
|
+
|
|
16
|
+
from meshtrade.common import BaseGRPCClient
|
|
17
|
+
from meshtrade.iam.api_user.v1.api_credentials import find_credentials
|
|
18
|
+
|
|
19
|
+
from meshtrade.common.service_options import ServiceOptions
|
|
20
|
+
from .service_pb2 import (
|
|
21
|
+
GetTransactionStateRequest,
|
|
22
|
+
GetTransactionStateResponse,
|
|
23
|
+
MonitorTransactionStateRequest,
|
|
24
|
+
MonitorTransactionStateResponse,
|
|
25
|
+
)
|
|
26
|
+
from .service_pb2_grpc import TransactionServiceStub
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _create_transactionservice_stub(channel):
|
|
30
|
+
"""Factory function to create TransactionServiceStub from gRPC channel."""
|
|
31
|
+
return TransactionServiceStub(channel)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TransactionService(BaseGRPCClient):
|
|
35
|
+
"""TransactionService gRPC service with authentication, timeouts, and resource management.
|
|
36
|
+
|
|
37
|
+
This service provides a complete implementation of the TransactionService with proper authentication, timeout handling, and automatic resource cleanup.
|
|
38
|
+
|
|
39
|
+
Full Service documentation: https://meshtrade.github.io/api/docs/api-reference/ledger/transaction/v1
|
|
40
|
+
|
|
41
|
+
Basic service usage with default SDK Configuration:
|
|
42
|
+
```python
|
|
43
|
+
service = TransactionService()
|
|
44
|
+
|
|
45
|
+
with service: # `with` ensures proper clean up of underlying connection after use
|
|
46
|
+
response = service.get_api_user(request)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
With default configuration API credentials are searched for using the standard discovery hierarchy:
|
|
50
|
+
|
|
51
|
+
1. MESH_API_CREDENTIALS environment variable
|
|
52
|
+
|
|
53
|
+
2. Default credential file location:
|
|
54
|
+
|
|
55
|
+
- Linux: `$XDG_CONFIG_HOME/mesh/credentials.json` or fallback to `$HOME/.config/mesh/credentials.json`
|
|
56
|
+
- macOS: `$HOME/Library/Application Support/mesh/credentials.json`
|
|
57
|
+
- Windows: `C:\\Users\\<user>\\AppData\\Roaming\\mesh\\credentials.json`
|
|
58
|
+
|
|
59
|
+
For more information on authentication: https://meshtrade.github.io/api/docs/architecture/authentication
|
|
60
|
+
|
|
61
|
+
The service may also be configured with custom options:
|
|
62
|
+
```python
|
|
63
|
+
from .service_options_meshpy import ServiceOptions
|
|
64
|
+
from datetime import timedelta
|
|
65
|
+
|
|
66
|
+
options = ServiceOptions(
|
|
67
|
+
url="api.staging.example.com",
|
|
68
|
+
port=443,
|
|
69
|
+
api_key="your-api-key",
|
|
70
|
+
group="groups/your-group-id",
|
|
71
|
+
timeout=timedelta(seconds=60)
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
service = TransactionService(options)
|
|
75
|
+
|
|
76
|
+
with service: # `with` ensures proper clean up of underlying connection after use
|
|
77
|
+
response = service.get_api_user(request)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
For more information on service configuration: https://meshtrade.github.io/api/docs/architecture/sdk-configuration
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
def __init__(self, options: Optional[ServiceOptions] = None):
|
|
84
|
+
"""Construct and initialize the TransactionService service.
|
|
85
|
+
|
|
86
|
+
Full Service documentation: https://meshtrade.github.io/api/docs/api-reference/ledger/transaction/v1
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
options: Optional ServiceOptions for configuring the service.
|
|
90
|
+
If None, service is constructed with default configuration.
|
|
91
|
+
With default configuration API credentials are searched for using the standard discovery hierarchy:
|
|
92
|
+
|
|
93
|
+
1. MESH_API_CREDENTIALS environment variable
|
|
94
|
+
|
|
95
|
+
2. Default credential file location:
|
|
96
|
+
|
|
97
|
+
- Linux: `$XDG_CONFIG_HOME/mesh/credentials.json` or fallback to `$HOME/.config/mesh/credentials.json`
|
|
98
|
+
- macOS: `$HOME/Library/Application Support/mesh/credentials.json`
|
|
99
|
+
- Windows: `C:\\Users\\<user>\\AppData\\Roaming\\mesh\\credentials.json`
|
|
100
|
+
|
|
101
|
+
For more information on authentication: https://meshtrade.github.io/api/docs/architecture/authentication
|
|
102
|
+
|
|
103
|
+
For more information on service configuration: https://meshtrade.github.io/api/docs/architecture/sdk-configuration
|
|
104
|
+
|
|
105
|
+
Example:
|
|
106
|
+
```python
|
|
107
|
+
# construct with default configuration
|
|
108
|
+
service = TransactionService()
|
|
109
|
+
|
|
110
|
+
# construct with custom configuration
|
|
111
|
+
options = ServiceOptions(
|
|
112
|
+
url="api.example.com",
|
|
113
|
+
api_key="your-key",
|
|
114
|
+
group="groups/your-group"
|
|
115
|
+
)
|
|
116
|
+
service = TransactionService(options)
|
|
117
|
+
```
|
|
118
|
+
"""
|
|
119
|
+
if options is None:
|
|
120
|
+
options = ServiceOptions()
|
|
121
|
+
|
|
122
|
+
# Initialize the base client with all common functionality
|
|
123
|
+
super().__init__(
|
|
124
|
+
service_name="TransactionService",
|
|
125
|
+
stub_factory=_create_transactionservice_stub,
|
|
126
|
+
find_credentials_func=find_credentials,
|
|
127
|
+
url=options.url,
|
|
128
|
+
port=options.port,
|
|
129
|
+
api_key=options.api_key,
|
|
130
|
+
group=options.group,
|
|
131
|
+
timeout=options.timeout,
|
|
132
|
+
tls=options.tls,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
def get_transaction_state(self, request: GetTransactionStateRequest, timeout: Optional[timedelta] = None) -> GetTransactionStateResponse:
|
|
136
|
+
"""GetTransactionState method.
|
|
137
|
+
|
|
138
|
+
Args:
|
|
139
|
+
request: The GetTransactionState request message
|
|
140
|
+
timeout: Optional timeout override for this call
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
The GetTransactionState response message
|
|
144
|
+
|
|
145
|
+
Raises:
|
|
146
|
+
grpc.RpcError: If the gRPC call fails
|
|
147
|
+
ValueError: If authentication credentials are missing
|
|
148
|
+
"""
|
|
149
|
+
return self._execute_method("GetTransactionState", request, timeout)
|
|
150
|
+
|
|
151
|
+
def monitor_transaction_state(self, request: MonitorTransactionStateRequest, timeout: Optional[timedelta] = None) -> Iterator[MonitorTransactionStateResponse]:
|
|
152
|
+
"""MonitorTransactionState server-side streaming method with authentication and validation.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
request: The MonitorTransactionState request message
|
|
156
|
+
timeout: Optional timeout override for this call
|
|
157
|
+
|
|
158
|
+
Yields:
|
|
159
|
+
MonitorTransactionStateResponse: Stream of response messages
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
grpc.RpcError: If the gRPC call fails
|
|
163
|
+
ValueError: If authentication credentials are missing or request validation fails
|
|
164
|
+
|
|
165
|
+
Example:
|
|
166
|
+
>>> stream = service.monitor_transaction_state(request)
|
|
167
|
+
>>> for response in stream:
|
|
168
|
+
... # Process each response
|
|
169
|
+
... print(response)
|
|
170
|
+
"""
|
|
171
|
+
return self._execute_streaming_method("MonitorTransactionState", request, timeout)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
# Create aliases to match expected exports
|
|
175
|
+
TransactionServiceGRPCClient = TransactionService
|
|
176
|
+
TransactionServiceGRPCClientInterface = TransactionService
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: meshtrade/ledger/transaction/v1/service.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'meshtrade/ledger/transaction/v1/service.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
|
|
26
|
+
from meshtrade.ledger.transaction.v1 import transaction_state_pb2 as meshtrade_dot_ledger_dot_transaction_dot_v1_dot_transaction__state__pb2
|
|
27
|
+
from meshtrade.option.method_options.v1 import method_options_pb2 as meshtrade_dot_option_dot_method__options_dot_v1_dot_method__options__pb2
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-meshtrade/ledger/transaction/v1/service.proto\x12\x1fmeshtrade.ledger.transaction.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x37meshtrade/ledger/transaction/v1/transaction_state.proto\x1a\x37meshtrade/option/method_options/v1/method_options.proto\"t\n\x1aGetTransactionStateRequest\x12V\n\x04name\x18\x01 \x01(\tBB\xbaH?r:25^transactions/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01\'\xc8\x01\x01R\x04name\"f\n\x1bGetTransactionStateResponse\x12G\n\x05state\x18\x01 \x01(\x0e\x32\x31.meshtrade.ledger.transaction.v1.TransactionStateR\x05state\"x\n\x1eMonitorTransactionStateRequest\x12V\n\x04name\x18\x01 \x01(\tBB\xbaH?r:25^transactions/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01\'\xc8\x01\x01R\x04name\"j\n\x1fMonitorTransactionStateResponse\x12G\n\x05state\x18\x01 \x01(\x0e\x32\x31.meshtrade.ledger.transaction.v1.TransactionStateR\x05state2\x80\x03\n\x12TransactionService\x12\xac\x01\n\x13GetTransactionState\x12;.meshtrade.ledger.transaction.v1.GetTransactionStateRequest\x1a<.meshtrade.ledger.transaction.v1.GetTransactionStateResponse\"\x1a\xb2\xb5\x18\x16\x08\x01\x10\x02\x1a\x10\xc0\x9f\xab\x03\xc1\x9f\xab\x03\xc2\x9f\xab\x03\xc3\x9f\xab\x03\x12\xba\x01\n\x17MonitorTransactionState\x12?.meshtrade.ledger.transaction.v1.MonitorTransactionStateRequest\x1a@.meshtrade.ledger.transaction.v1.MonitorTransactionStateResponse\"\x1a\xb2\xb5\x18\x16\x08\x01\x10\x02\x1a\x10\xc0\x9f\xab\x03\xc1\x9f\xab\x03\xc2\x9f\xab\x03\xc3\x9f\xab\x03\x30\x01\x42j\n&co.meshtrade.api.ledger.transaction.v1Z@github.com/meshtrade/api/go/ledger/transaction/v1;transaction_v1b\x06proto3')
|
|
31
|
+
|
|
32
|
+
_globals = globals()
|
|
33
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
34
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.ledger.transaction.v1.service_pb2', _globals)
|
|
35
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
36
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
37
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n&co.meshtrade.api.ledger.transaction.v1Z@github.com/meshtrade/api/go/ledger/transaction/v1;transaction_v1'
|
|
38
|
+
_globals['_GETTRANSACTIONSTATEREQUEST'].fields_by_name['name']._loaded_options = None
|
|
39
|
+
_globals['_GETTRANSACTIONSTATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H?r:25^transactions/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001\'\310\001\001'
|
|
40
|
+
_globals['_MONITORTRANSACTIONSTATEREQUEST'].fields_by_name['name']._loaded_options = None
|
|
41
|
+
_globals['_MONITORTRANSACTIONSTATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H?r:25^transactions/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001\'\310\001\001'
|
|
42
|
+
_globals['_TRANSACTIONSERVICE'].methods_by_name['GetTransactionState']._loaded_options = None
|
|
43
|
+
_globals['_TRANSACTIONSERVICE'].methods_by_name['GetTransactionState']._serialized_options = b'\262\265\030\026\010\001\020\002\032\020\300\237\253\003\301\237\253\003\302\237\253\003\303\237\253\003'
|
|
44
|
+
_globals['_TRANSACTIONSERVICE'].methods_by_name['MonitorTransactionState']._loaded_options = None
|
|
45
|
+
_globals['_TRANSACTIONSERVICE'].methods_by_name['MonitorTransactionState']._serialized_options = b'\262\265\030\026\010\001\020\002\032\020\300\237\253\003\301\237\253\003\302\237\253\003\303\237\253\003'
|
|
46
|
+
_globals['_GETTRANSACTIONSTATEREQUEST']._serialized_start=225
|
|
47
|
+
_globals['_GETTRANSACTIONSTATEREQUEST']._serialized_end=341
|
|
48
|
+
_globals['_GETTRANSACTIONSTATERESPONSE']._serialized_start=343
|
|
49
|
+
_globals['_GETTRANSACTIONSTATERESPONSE']._serialized_end=445
|
|
50
|
+
_globals['_MONITORTRANSACTIONSTATEREQUEST']._serialized_start=447
|
|
51
|
+
_globals['_MONITORTRANSACTIONSTATEREQUEST']._serialized_end=567
|
|
52
|
+
_globals['_MONITORTRANSACTIONSTATERESPONSE']._serialized_start=569
|
|
53
|
+
_globals['_MONITORTRANSACTIONSTATERESPONSE']._serialized_end=675
|
|
54
|
+
_globals['_TRANSACTIONSERVICE']._serialized_start=678
|
|
55
|
+
_globals['_TRANSACTIONSERVICE']._serialized_end=1062
|
|
56
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from buf.validate import validate_pb2 as _validate_pb2
|
|
2
|
+
from meshtrade.ledger.transaction.v1 import transaction_state_pb2 as _transaction_state_pb2
|
|
3
|
+
from meshtrade.option.method_options.v1 import method_options_pb2 as _method_options_pb2
|
|
4
|
+
from google.protobuf import descriptor as _descriptor
|
|
5
|
+
from google.protobuf import message as _message
|
|
6
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
7
|
+
|
|
8
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
9
|
+
|
|
10
|
+
class GetTransactionStateRequest(_message.Message):
|
|
11
|
+
__slots__ = ("name",)
|
|
12
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
name: str
|
|
14
|
+
def __init__(self, name: _Optional[str] = ...) -> None: ...
|
|
15
|
+
|
|
16
|
+
class GetTransactionStateResponse(_message.Message):
|
|
17
|
+
__slots__ = ("state",)
|
|
18
|
+
STATE_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
state: _transaction_state_pb2.TransactionState
|
|
20
|
+
def __init__(self, state: _Optional[_Union[_transaction_state_pb2.TransactionState, str]] = ...) -> None: ...
|
|
21
|
+
|
|
22
|
+
class MonitorTransactionStateRequest(_message.Message):
|
|
23
|
+
__slots__ = ("name",)
|
|
24
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
name: str
|
|
26
|
+
def __init__(self, name: _Optional[str] = ...) -> None: ...
|
|
27
|
+
|
|
28
|
+
class MonitorTransactionStateResponse(_message.Message):
|
|
29
|
+
__slots__ = ("state",)
|
|
30
|
+
STATE_FIELD_NUMBER: _ClassVar[int]
|
|
31
|
+
state: _transaction_state_pb2.TransactionState
|
|
32
|
+
def __init__(self, state: _Optional[_Union[_transaction_state_pb2.TransactionState, str]] = ...) -> None: ...
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from meshtrade.ledger.transaction.v1 import service_pb2 as meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TransactionServiceStub(object):
|
|
9
|
+
"""
|
|
10
|
+
TransactionService manages Transaction lifecycle.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, channel):
|
|
14
|
+
"""Constructor.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
channel: A grpc.Channel.
|
|
18
|
+
"""
|
|
19
|
+
self.GetTransactionState = channel.unary_unary(
|
|
20
|
+
'/meshtrade.ledger.transaction.v1.TransactionService/GetTransactionState',
|
|
21
|
+
request_serializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.GetTransactionStateRequest.SerializeToString,
|
|
22
|
+
response_deserializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.GetTransactionStateResponse.FromString,
|
|
23
|
+
_registered_method=True)
|
|
24
|
+
self.MonitorTransactionState = channel.unary_stream(
|
|
25
|
+
'/meshtrade.ledger.transaction.v1.TransactionService/MonitorTransactionState',
|
|
26
|
+
request_serializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.MonitorTransactionStateRequest.SerializeToString,
|
|
27
|
+
response_deserializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.MonitorTransactionStateResponse.FromString,
|
|
28
|
+
_registered_method=True)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TransactionServiceServicer(object):
|
|
32
|
+
"""
|
|
33
|
+
TransactionService manages Transaction lifecycle.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def GetTransactionState(self, request, context):
|
|
37
|
+
"""
|
|
38
|
+
Retrieves a single Transaction state by the unique identifier of the transaction
|
|
39
|
+
"""
|
|
40
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
41
|
+
context.set_details('Method not implemented!')
|
|
42
|
+
raise NotImplementedError('Method not implemented!')
|
|
43
|
+
|
|
44
|
+
def MonitorTransactionState(self, request, context):
|
|
45
|
+
"""
|
|
46
|
+
Monitor Transaction state changes by the unique identifier of the transaction.
|
|
47
|
+
Server-side streaming method that sends state updates as the transaction progresses.
|
|
48
|
+
"""
|
|
49
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
50
|
+
context.set_details('Method not implemented!')
|
|
51
|
+
raise NotImplementedError('Method not implemented!')
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def add_TransactionServiceServicer_to_server(servicer, server):
|
|
55
|
+
rpc_method_handlers = {
|
|
56
|
+
'GetTransactionState': grpc.unary_unary_rpc_method_handler(
|
|
57
|
+
servicer.GetTransactionState,
|
|
58
|
+
request_deserializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.GetTransactionStateRequest.FromString,
|
|
59
|
+
response_serializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.GetTransactionStateResponse.SerializeToString,
|
|
60
|
+
),
|
|
61
|
+
'MonitorTransactionState': grpc.unary_stream_rpc_method_handler(
|
|
62
|
+
servicer.MonitorTransactionState,
|
|
63
|
+
request_deserializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.MonitorTransactionStateRequest.FromString,
|
|
64
|
+
response_serializer=meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.MonitorTransactionStateResponse.SerializeToString,
|
|
65
|
+
),
|
|
66
|
+
}
|
|
67
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
68
|
+
'meshtrade.ledger.transaction.v1.TransactionService', rpc_method_handlers)
|
|
69
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
70
|
+
server.add_registered_method_handlers('meshtrade.ledger.transaction.v1.TransactionService', rpc_method_handlers)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# This class is part of an EXPERIMENTAL API.
|
|
74
|
+
class TransactionService(object):
|
|
75
|
+
"""
|
|
76
|
+
TransactionService manages Transaction lifecycle.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
@staticmethod
|
|
80
|
+
def GetTransactionState(request,
|
|
81
|
+
target,
|
|
82
|
+
options=(),
|
|
83
|
+
channel_credentials=None,
|
|
84
|
+
call_credentials=None,
|
|
85
|
+
insecure=False,
|
|
86
|
+
compression=None,
|
|
87
|
+
wait_for_ready=None,
|
|
88
|
+
timeout=None,
|
|
89
|
+
metadata=None):
|
|
90
|
+
return grpc.experimental.unary_unary(
|
|
91
|
+
request,
|
|
92
|
+
target,
|
|
93
|
+
'/meshtrade.ledger.transaction.v1.TransactionService/GetTransactionState',
|
|
94
|
+
meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.GetTransactionStateRequest.SerializeToString,
|
|
95
|
+
meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.GetTransactionStateResponse.FromString,
|
|
96
|
+
options,
|
|
97
|
+
channel_credentials,
|
|
98
|
+
insecure,
|
|
99
|
+
call_credentials,
|
|
100
|
+
compression,
|
|
101
|
+
wait_for_ready,
|
|
102
|
+
timeout,
|
|
103
|
+
metadata,
|
|
104
|
+
_registered_method=True)
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
def MonitorTransactionState(request,
|
|
108
|
+
target,
|
|
109
|
+
options=(),
|
|
110
|
+
channel_credentials=None,
|
|
111
|
+
call_credentials=None,
|
|
112
|
+
insecure=False,
|
|
113
|
+
compression=None,
|
|
114
|
+
wait_for_ready=None,
|
|
115
|
+
timeout=None,
|
|
116
|
+
metadata=None):
|
|
117
|
+
return grpc.experimental.unary_stream(
|
|
118
|
+
request,
|
|
119
|
+
target,
|
|
120
|
+
'/meshtrade.ledger.transaction.v1.TransactionService/MonitorTransactionState',
|
|
121
|
+
meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.MonitorTransactionStateRequest.SerializeToString,
|
|
122
|
+
meshtrade_dot_ledger_dot_transaction_dot_v1_dot_service__pb2.MonitorTransactionStateResponse.FromString,
|
|
123
|
+
options,
|
|
124
|
+
channel_credentials,
|
|
125
|
+
insecure,
|
|
126
|
+
call_credentials,
|
|
127
|
+
compression,
|
|
128
|
+
wait_for_ready,
|
|
129
|
+
timeout,
|
|
130
|
+
metadata,
|
|
131
|
+
_registered_method=True)
|
|
@@ -24,14 +24,14 @@ _sym_db = _symbol_database.Default()
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8meshtrade/ledger/transaction/v1/transaction_action.proto\x12\x1fmeshtrade.ledger.transaction.v1*\xf8\x01\n\x11TransactionAction\x12\"\n\x1eTRANSACTION_ACTION_UNSPECIFIED\x10\x00\x12!\n\x1dTRANSACTION_ACTION_DO_NOTHING\x10\x01\x12\x1c\n\x18TRANSACTION_ACTION_BUILD\x10\x02\x12\x1d\n\x19TRANSACTION_ACTION_COMMIT\x10\x03\x12\x1b\n\x17TRANSACTION_ACTION_SIGN\x10\x04\x12#\n\x1fTRANSACTION_ACTION_MARK_PENDING\x10\x05\x12\x1d\n\x19TRANSACTION_ACTION_SUBMIT\x10\x06\
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n8meshtrade/ledger/transaction/v1/transaction_action.proto\x12\x1fmeshtrade.ledger.transaction.v1*\xf8\x01\n\x11TransactionAction\x12\"\n\x1eTRANSACTION_ACTION_UNSPECIFIED\x10\x00\x12!\n\x1dTRANSACTION_ACTION_DO_NOTHING\x10\x01\x12\x1c\n\x18TRANSACTION_ACTION_BUILD\x10\x02\x12\x1d\n\x19TRANSACTION_ACTION_COMMIT\x10\x03\x12\x1b\n\x17TRANSACTION_ACTION_SIGN\x10\x04\x12#\n\x1fTRANSACTION_ACTION_MARK_PENDING\x10\x05\x12\x1d\n\x19TRANSACTION_ACTION_SUBMIT\x10\x06\x42j\n&co.meshtrade.api.ledger.transaction.v1Z@github.com/meshtrade/api/go/ledger/transaction/v1;transaction_v1b\x06proto3')
|
|
28
28
|
|
|
29
29
|
_globals = globals()
|
|
30
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
31
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.ledger.transaction.v1.transaction_action_pb2', _globals)
|
|
32
32
|
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
33
|
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
-
_globals['DESCRIPTOR']._serialized_options = b'\n&co.meshtrade.api.ledger.transaction.v1Z
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n&co.meshtrade.api.ledger.transaction.v1Z@github.com/meshtrade/api/go/ledger/transaction/v1;transaction_v1'
|
|
35
35
|
_globals['_TRANSACTIONACTION']._serialized_start=94
|
|
36
36
|
_globals['_TRANSACTIONACTION']._serialized_end=342
|
|
37
37
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""Transaction state machine validation and transition logic.
|
|
2
|
+
|
|
3
|
+
This module provides state machine functions for transaction states and actions,
|
|
4
|
+
implementing the transaction lifecycle management logic.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from meshtrade.ledger.transaction.v1.transaction_action_pb2 import TransactionAction
|
|
8
|
+
from meshtrade.ledger.transaction.v1.transaction_state_pb2 import TransactionState
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def transaction_state_can_perform_action_at_state(state: TransactionState | None, action: TransactionAction | None) -> bool:
|
|
12
|
+
"""Check if the given action can be performed at the current transaction state.
|
|
13
|
+
|
|
14
|
+
This implements the state machine logic for transaction lifecycle management.
|
|
15
|
+
|
|
16
|
+
State Transitions:
|
|
17
|
+
- DRAFT -> BUILD/COMMIT -> SIGNING_IN_PROGRESS
|
|
18
|
+
- SIGNING_IN_PROGRESS -> SIGN/MARK_PENDING -> PENDING
|
|
19
|
+
- PENDING -> SUBMIT -> SUBMISSION_IN_PROGRESS
|
|
20
|
+
- SUBMISSION_IN_PROGRESS -> SUBMIT (retry) -> INDETERMINATE or SUCCESS/FAILED
|
|
21
|
+
- INDETERMINATE -> SUBMIT (retry) -> SUCCESS/FAILED
|
|
22
|
+
- FAILED/SUCCESSFUL -> No further actions allowed (terminal states)
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
state: The current TransactionState (can be None)
|
|
26
|
+
action: The TransactionAction to perform (can be None)
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
True if the action can be performed at the given state, False otherwise
|
|
30
|
+
|
|
31
|
+
None Safety:
|
|
32
|
+
Returns False if either state or action is None
|
|
33
|
+
|
|
34
|
+
Example:
|
|
35
|
+
>>> transaction_state_can_perform_action_at_state(
|
|
36
|
+
... TransactionState.TRANSACTION_STATE_DRAFT,
|
|
37
|
+
... TransactionAction.TRANSACTION_ACTION_BUILD
|
|
38
|
+
... )
|
|
39
|
+
True
|
|
40
|
+
>>> transaction_state_can_perform_action_at_state(
|
|
41
|
+
... TransactionState.TRANSACTION_STATE_SUCCESSFUL,
|
|
42
|
+
... TransactionAction.TRANSACTION_ACTION_SUBMIT
|
|
43
|
+
... )
|
|
44
|
+
False
|
|
45
|
+
"""
|
|
46
|
+
if state is None or action is None:
|
|
47
|
+
return False
|
|
48
|
+
|
|
49
|
+
if state == TransactionState.TRANSACTION_STATE_DRAFT:
|
|
50
|
+
return action in {
|
|
51
|
+
TransactionAction.TRANSACTION_ACTION_BUILD,
|
|
52
|
+
TransactionAction.TRANSACTION_ACTION_COMMIT,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
elif state == TransactionState.TRANSACTION_STATE_SIGNING_IN_PROGRESS:
|
|
56
|
+
return action in {
|
|
57
|
+
TransactionAction.TRANSACTION_ACTION_SIGN,
|
|
58
|
+
TransactionAction.TRANSACTION_ACTION_MARK_PENDING,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
elif state in {
|
|
62
|
+
TransactionState.TRANSACTION_STATE_PENDING,
|
|
63
|
+
TransactionState.TRANSACTION_STATE_SUBMISSION_IN_PROGRESS,
|
|
64
|
+
TransactionState.TRANSACTION_STATE_INDETERMINATE,
|
|
65
|
+
}:
|
|
66
|
+
return action == TransactionAction.TRANSACTION_ACTION_SUBMIT
|
|
67
|
+
|
|
68
|
+
elif state in {
|
|
69
|
+
TransactionState.TRANSACTION_STATE_FAILED,
|
|
70
|
+
TransactionState.TRANSACTION_STATE_SUCCESSFUL,
|
|
71
|
+
}:
|
|
72
|
+
return False
|
|
73
|
+
|
|
74
|
+
else:
|
|
75
|
+
return False
|
|
@@ -24,14 +24,14 @@ _sym_db = _symbol_database.Default()
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7meshtrade/ledger/transaction/v1/transaction_state.proto\x12\x1fmeshtrade.ledger.transaction.v1*\xaf\x02\n\x10TransactionState\x12!\n\x1dTRANSACTION_STATE_UNSPECIFIED\x10\x00\x12\x1b\n\x17TRANSACTION_STATE_DRAFT\x10\x01\x12)\n%TRANSACTION_STATE_SIGNING_IN_PROGRESS\x10\x02\x12\x1d\n\x19TRANSACTION_STATE_PENDING\x10\x03\x12,\n(TRANSACTION_STATE_SUBMISSION_IN_PROGRESS\x10\x04\x12\x1c\n\x18TRANSACTION_STATE_FAILED\x10\x05\x12#\n\x1fTRANSACTION_STATE_INDETERMINATE\x10\x06\x12 \n\x1cTRANSACTION_STATE_SUCCESSFUL\x10\x07\
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7meshtrade/ledger/transaction/v1/transaction_state.proto\x12\x1fmeshtrade.ledger.transaction.v1*\xaf\x02\n\x10TransactionState\x12!\n\x1dTRANSACTION_STATE_UNSPECIFIED\x10\x00\x12\x1b\n\x17TRANSACTION_STATE_DRAFT\x10\x01\x12)\n%TRANSACTION_STATE_SIGNING_IN_PROGRESS\x10\x02\x12\x1d\n\x19TRANSACTION_STATE_PENDING\x10\x03\x12,\n(TRANSACTION_STATE_SUBMISSION_IN_PROGRESS\x10\x04\x12\x1c\n\x18TRANSACTION_STATE_FAILED\x10\x05\x12#\n\x1fTRANSACTION_STATE_INDETERMINATE\x10\x06\x12 \n\x1cTRANSACTION_STATE_SUCCESSFUL\x10\x07\x42j\n&co.meshtrade.api.ledger.transaction.v1Z@github.com/meshtrade/api/go/ledger/transaction/v1;transaction_v1b\x06proto3')
|
|
28
28
|
|
|
29
29
|
_globals = globals()
|
|
30
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
31
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.ledger.transaction.v1.transaction_state_pb2', _globals)
|
|
32
32
|
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
33
|
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
-
_globals['DESCRIPTOR']._serialized_options = b'\n&co.meshtrade.api.ledger.transaction.v1Z
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n&co.meshtrade.api.ledger.transaction.v1Z@github.com/meshtrade/api/go/ledger/transaction/v1;transaction_v1'
|
|
35
35
|
_globals['_TRANSACTIONSTATE']._serialized_start=93
|
|
36
36
|
_globals['_TRANSACTIONSTATE']._serialized_end=396
|
|
37
37
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Price v1 package."""
|
|
2
2
|
|
|
3
3
|
# ===================================================================
|
|
4
4
|
# AUTO-GENERATED SECTION - ONLY EDIT BELOW THE CLOSING COMMENT BLOCK
|
|
@@ -13,18 +13,15 @@
|
|
|
13
13
|
# ===================================================================
|
|
14
14
|
|
|
15
15
|
# Generated protobuf imports
|
|
16
|
-
from .
|
|
17
|
-
from .
|
|
18
|
-
from .income_report_pb2 import IncomeReport
|
|
19
|
-
from .service_pb2 import GetExcelIncomeReportRequest, GetExcelIncomeReportResponse, GetIncomeReportRequest
|
|
16
|
+
from .price_pb2 import Price
|
|
17
|
+
from .service_pb2 import GetCurrentPriceByTokenPairRequest
|
|
20
18
|
|
|
21
19
|
# Generated service imports
|
|
22
20
|
from .service_meshpy import (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
PriceService,
|
|
22
|
+
PriceServiceGRPCClient,
|
|
23
|
+
PriceServiceGRPCClientInterface,
|
|
26
24
|
)
|
|
27
|
-
from .service_options_meshpy import ClientOptions
|
|
28
25
|
|
|
29
26
|
# ===================================================================
|
|
30
27
|
# END OF AUTO-GENERATED SECTION
|
|
@@ -46,15 +43,9 @@ from .service_options_meshpy import ClientOptions
|
|
|
46
43
|
# Combined auto-generated and manual exports
|
|
47
44
|
__all__ = [
|
|
48
45
|
# Generated exports
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"GetIncomeReportRequest",
|
|
55
|
-
"IncomeReport",
|
|
56
|
-
"IncomeReportService",
|
|
57
|
-
"IncomeReportServiceGRPCClient",
|
|
58
|
-
"IncomeReportServiceGRPCClientInterface",
|
|
59
|
-
"Narrative",
|
|
46
|
+
"GetCurrentPriceByTokenPairRequest",
|
|
47
|
+
"Price",
|
|
48
|
+
"PriceService",
|
|
49
|
+
"PriceServiceGRPCClient",
|
|
50
|
+
"PriceServiceGRPCClientInterface",
|
|
60
51
|
]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: meshtrade/market_data/price/v1/price.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'meshtrade/market_data/price/v1/price.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
26
|
+
from meshtrade.type.v1 import decimal_pb2 as meshtrade_dot_type_dot_v1_dot_decimal__pb2
|
|
27
|
+
from meshtrade.type.v1 import token_pb2 as meshtrade_dot_type_dot_v1_dot_token__pb2
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*meshtrade/market_data/price/v1/price.proto\x12\x1emeshtrade.market_data.price.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1fmeshtrade/type/v1/decimal.proto\x1a\x1dmeshtrade/type/v1/token.proto\"\xe4\x01\n\x05Price\x12\x37\n\nbase_token\x18\x01 \x01(\x0b\x32\x18.meshtrade.type.v1.TokenR\tbaseToken\x12\x39\n\x0bquote_token\x18\x02 \x01(\x0b\x32\x18.meshtrade.type.v1.TokenR\nquoteToken\x12\x37\n\tmid_price\x18\x03 \x01(\x0b\x32\x1a.meshtrade.type.v1.DecimalR\x08midPrice\x12.\n\x04time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04timeBb\n%co.meshtrade.api.market_data.price.v1Z9github.com/meshtrade/api/go/market_data/price/v1;price_v1b\x06proto3')
|
|
31
|
+
|
|
32
|
+
_globals = globals()
|
|
33
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
34
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.market_data.price.v1.price_pb2', _globals)
|
|
35
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
36
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
37
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.market_data.price.v1Z9github.com/meshtrade/api/go/market_data/price/v1;price_v1'
|
|
38
|
+
_globals['_PRICE']._serialized_start=176
|
|
39
|
+
_globals['_PRICE']._serialized_end=404
|
|
40
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
3
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
4
|
+
from meshtrade.type.v1 import decimal_pb2 as _decimal_pb2
|
|
5
|
+
from meshtrade.type.v1 import token_pb2 as _token_pb2
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import message as _message
|
|
8
|
+
from collections.abc import Mapping as _Mapping
|
|
9
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
10
|
+
|
|
11
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
12
|
+
|
|
13
|
+
class Price(_message.Message):
|
|
14
|
+
__slots__ = ("base_token", "quote_token", "mid_price", "time")
|
|
15
|
+
BASE_TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
16
|
+
QUOTE_TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
17
|
+
MID_PRICE_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
TIME_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
base_token: _token_pb2.Token
|
|
20
|
+
quote_token: _token_pb2.Token
|
|
21
|
+
mid_price: _decimal_pb2.Decimal
|
|
22
|
+
time: _timestamp_pb2.Timestamp
|
|
23
|
+
def __init__(self, base_token: _Optional[_Union[_token_pb2.Token, _Mapping]] = ..., quote_token: _Optional[_Union[_token_pb2.Token, _Mapping]] = ..., mid_price: _Optional[_Union[_decimal_pb2.Decimal, _Mapping]] = ..., time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...
|