meshtrade 1.12.0__py3-none-any.whl → 1.19.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.

Potentially problematic release.


This version of meshtrade might be problematic. Click here for more details.

Files changed (33) hide show
  1. meshtrade/common/grpc_client.py +47 -0
  2. meshtrade/iam/api_user/v1/__init__.py +2 -0
  3. meshtrade/iam/api_user/v1/api_user_pb2.py +7 -7
  4. meshtrade/iam/api_user/v1/service_meshpy.py +17 -0
  5. meshtrade/iam/api_user/v1/service_pb2.py +25 -17
  6. meshtrade/iam/api_user/v1/service_pb2.pyi +8 -0
  7. meshtrade/iam/api_user/v1/service_pb2_grpc.py +49 -0
  8. meshtrade/iam/role/v1/role_pb2.py +2 -2
  9. meshtrade/iam/role/v1/role_pb2.pyi +8 -0
  10. meshtrade/iam/user/v1/service_pb2.py +23 -23
  11. meshtrade/iam/user/v1/user_pb2.py +3 -3
  12. meshtrade/ledger/transaction/v1/__init__.py +23 -1
  13. meshtrade/ledger/transaction/v1/service_meshpy.py +175 -0
  14. meshtrade/ledger/transaction/v1/service_options_meshpy.py +65 -0
  15. meshtrade/ledger/transaction/v1/service_pb2.py +57 -0
  16. meshtrade/ledger/transaction/v1/service_pb2.pyi +33 -0
  17. meshtrade/ledger/transaction/v1/service_pb2_grpc.py +131 -0
  18. meshtrade/studio/instrument/v1/__init__.py +1 -1
  19. meshtrade/studio/instrument/v1/instrument_type_pb2.py +37 -0
  20. meshtrade/studio/instrument/v1/{type_pb2.pyi → instrument_type_pb2.pyi} +6 -0
  21. meshtrade/wallet/account/v1/__init__.py +0 -4
  22. meshtrade/wallet/account/v1/account_pb2.py +10 -10
  23. meshtrade/wallet/account/v1/account_pb2.pyi +3 -3
  24. meshtrade/wallet/account/v1/service_meshpy.py +0 -18
  25. meshtrade/wallet/account/v1/service_pb2.py +19 -27
  26. meshtrade/wallet/account/v1/service_pb2.pyi +0 -14
  27. meshtrade/wallet/account/v1/service_pb2_grpc.py +0 -49
  28. {meshtrade-1.12.0.dist-info → meshtrade-1.19.0.dist-info}/METADATA +1 -1
  29. {meshtrade-1.12.0.dist-info → meshtrade-1.19.0.dist-info}/RECORD +32 -27
  30. meshtrade/studio/instrument/v1/type_pb2.py +0 -37
  31. /meshtrade/studio/instrument/v1/{type_pb2_grpc.py → instrument_type_pb2_grpc.py} +0 -0
  32. {meshtrade-1.12.0.dist-info → meshtrade-1.19.0.dist-info}/WHEEL +0 -0
  33. {meshtrade-1.12.0.dist-info → meshtrade-1.19.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,175 @@
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 datetime import timedelta
13
+ from typing import Optional
14
+
15
+ from meshtrade.common import BaseGRPCClient
16
+ from meshtrade.iam.api_user.v1.api_credentials import find_credentials
17
+
18
+ from .service_options_meshpy import ServiceOptions
19
+ from .service_pb2 import (
20
+ GetTransactionStateRequest,
21
+ GetTransactionStateResponse,
22
+ MonitorTransactionStateRequest,
23
+ MonitorTransactionStateResponse,
24
+ )
25
+ from .service_pb2_grpc import TransactionServiceStub
26
+
27
+
28
+ def _create_transactionservice_stub(channel):
29
+ """Factory function to create TransactionServiceStub from gRPC channel."""
30
+ return TransactionServiceStub(channel)
31
+
32
+
33
+ class TransactionService(BaseGRPCClient):
34
+ """TransactionService gRPC service with authentication, timeouts, and resource management.
35
+
36
+ This service provides a complete implementation of the TransactionService with proper authentication, timeout handling, and automatic resource cleanup.
37
+
38
+ Full Service documentation: https://meshtrade.github.io/api/docs/api-reference/ledger/transaction/v1
39
+
40
+ Basic service usage with default SDK Configuration:
41
+ ```python
42
+ service = TransactionService()
43
+
44
+ with service: # `with` ensures proper clean up of underlying connection after use
45
+ response = service.get_api_user(request)
46
+ ```
47
+
48
+ With default configuration API credentials are searched for using the standard discovery hierarchy:
49
+
50
+ 1. MESH_API_CREDENTIALS environment variable
51
+
52
+ 2. Default credential file location:
53
+
54
+ - Linux: `$XDG_CONFIG_HOME/mesh/credentials.json` or fallback to `$HOME/.config/mesh/credentials.json`
55
+ - macOS: `$HOME/Library/Application Support/mesh/credentials.json`
56
+ - Windows: `C:\\Users\\<user>\\AppData\\Roaming\\mesh\\credentials.json`
57
+
58
+ For more information on authentication: https://meshtrade.github.io/api/docs/architecture/authentication
59
+
60
+ The service may also be configured with custom options:
61
+ ```python
62
+ from .service_options_meshpy import ServiceOptions
63
+ from datetime import timedelta
64
+
65
+ options = ServiceOptions(
66
+ url="api.staging.example.com",
67
+ port=443,
68
+ api_key="your-api-key",
69
+ group="groups/your-group-id",
70
+ timeout=timedelta(seconds=60)
71
+ )
72
+
73
+ service = TransactionService(options)
74
+
75
+ with service: # `with` ensures proper clean up of underlying connection after use
76
+ response = service.get_api_user(request)
77
+ ```
78
+
79
+ For more information on service configuration: https://meshtrade.github.io/api/docs/architecture/sdk-configuration
80
+ """
81
+
82
+ def __init__(self, options: Optional[ServiceOptions] = None):
83
+ """Construct and initialize the TransactionService service.
84
+
85
+ Full Service documentation: https://meshtrade.github.io/api/docs/api-reference/ledger/transaction/v1
86
+
87
+ Args:
88
+ options: Optional ServiceOptions for configuring the service.
89
+ If None, service is constructed with default configuration.
90
+ With default configuration API credentials are searched for using the standard discovery hierarchy:
91
+
92
+ 1. MESH_API_CREDENTIALS environment variable
93
+
94
+ 2. Default credential file location:
95
+
96
+ - Linux: `$XDG_CONFIG_HOME/mesh/credentials.json` or fallback to `$HOME/.config/mesh/credentials.json`
97
+ - macOS: `$HOME/Library/Application Support/mesh/credentials.json`
98
+ - Windows: `C:\\Users\\<user>\\AppData\\Roaming\\mesh\\credentials.json`
99
+
100
+ For more information on authentication: https://meshtrade.github.io/api/docs/architecture/authentication
101
+
102
+ For more information on service configuration: https://meshtrade.github.io/api/docs/architecture/sdk-configuration
103
+
104
+ Example:
105
+ ```python
106
+ # construct with default configuration
107
+ service = TransactionService()
108
+
109
+ # construct with custom configuration
110
+ options = ServiceOptions(
111
+ url="api.example.com",
112
+ api_key="your-key",
113
+ group="groups/your-group"
114
+ )
115
+ service = TransactionService(options)
116
+ ```
117
+ """
118
+ if options is None:
119
+ options = ServiceOptions()
120
+
121
+ # Initialize the base client with all common functionality
122
+ super().__init__(
123
+ service_name="TransactionService",
124
+ stub_factory=_create_transactionservice_stub,
125
+ find_credentials_func=find_credentials,
126
+ url=options.url,
127
+ port=options.port,
128
+ api_key=options.api_key,
129
+ group=options.group,
130
+ timeout=options.timeout,
131
+ tls=options.tls,
132
+ )
133
+
134
+ def get_transaction_state(self, request: GetTransactionStateRequest, timeout: Optional[timedelta] = None) -> GetTransactionStateResponse:
135
+ """GetTransactionState method.
136
+
137
+ Args:
138
+ request: The GetTransactionState request message
139
+ timeout: Optional timeout override for this call
140
+
141
+ Returns:
142
+ The GetTransactionState response message
143
+
144
+ Raises:
145
+ grpc.RpcError: If the gRPC call fails
146
+ ValueError: If authentication credentials are missing
147
+ """
148
+ return self._execute_method("GetTransactionState", request, timeout)
149
+
150
+ def monitor_transaction_state(self, request: MonitorTransactionStateRequest, timeout: Optional[timedelta] = None):
151
+ """MonitorTransactionState server-side streaming method with authentication and validation.
152
+
153
+ Args:
154
+ request: The MonitorTransactionState request message
155
+ timeout: Optional timeout override for this call
156
+
157
+ Yields:
158
+ MonitorTransactionStateResponse: Stream of response messages
159
+
160
+ Raises:
161
+ grpc.RpcError: If the gRPC call fails
162
+ ValueError: If authentication credentials are missing or request validation fails
163
+
164
+ Example:
165
+ >>> stream = service.monitor_transaction_state(request)
166
+ >>> for response in stream:
167
+ ... # Process each response
168
+ ... print(response)
169
+ """
170
+ return self._execute_streaming_method("MonitorTransactionState", request, timeout)
171
+
172
+
173
+ # Create aliases to match expected exports
174
+ TransactionServiceGRPCClient = TransactionService
175
+ TransactionServiceGRPCClientInterface = TransactionService
@@ -0,0 +1,65 @@
1
+ # Code generated by protoc-gen-meshpy. DO NOT EDIT.
2
+ # source: meshtrade/ledger/transaction/v1/service.proto
3
+
4
+ """
5
+ Configuration options for TransactionService gRPC service.
6
+ This module provides a clean, extensible way to configure the service with optional
7
+ parameters while maintaining backward compatibility and readability.
8
+ """
9
+
10
+ from datetime import timedelta
11
+
12
+
13
+ class ServiceOptions:
14
+ """Configuration options for TransactionService gRPC service.
15
+
16
+ This class provides a clean, extensible way to configure the service with optional
17
+ parameters while maintaining backward compatibility and readability.
18
+ """
19
+
20
+ def __init__(
21
+ self,
22
+ tls: bool = True,
23
+ url: str | None = None,
24
+ port: int | None = None,
25
+ api_key: str | None = None,
26
+ group: str | None = None,
27
+ timeout: timedelta = timedelta(seconds=30),
28
+ ):
29
+ """Initialize service options.
30
+
31
+ Args:
32
+ tls: Whether to use TLS encryption for the gRPC connection.
33
+ When True, establishes a secure connection using TLS.
34
+ When False, uses an insecure connection.
35
+ Default: True (secure connection)
36
+
37
+ url: The server hostname or IP address (e.g., "api.example.com", "localhost").
38
+ Default: Uses DEFAULT_GRPC_URL from common module
39
+
40
+ port: The server port number (e.g., 443 for HTTPS, 8080 for development).
41
+ Default: Uses DEFAULT_GRPC_PORT from common module
42
+
43
+ api_key: The API key string (without "Bearer " prefix) for authentication.
44
+ The API key will be sent as a Bearer token in the Authorization header.
45
+ This is the primary authentication method for service-to-service communication.
46
+
47
+ group: The group resource name in format groups/{group_id} required for all API requests.
48
+ The group determines the authorization context for operations
49
+ and is sent as an "x-group" header with every request.
50
+
51
+ timeout: The default timeout for all gRPC method calls.
52
+ This timeout applies to individual method calls and helps prevent hanging requests.
53
+ If a request takes longer than the specified timeout, it will be cancelled.
54
+ Default: 30 seconds
55
+ """
56
+ self.tls = tls
57
+ self.url = url
58
+ self.port = port
59
+ self.api_key = api_key
60
+ self.group = group
61
+ self.timeout = timeout
62
+
63
+
64
+ # Create alias to match expected exports
65
+ ClientOptions = ServiceOptions
@@ -0,0 +1,57 @@
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.iam.role.v1 import role_pb2 as meshtrade_dot_iam_dot_role_dot_v1_dot_role__pb2
27
+ from meshtrade.option.v1 import method_type_pb2 as meshtrade_dot_option_dot_v1_dot_method__type__pb2
28
+ from meshtrade.ledger.transaction.v1 import transaction_state_pb2 as meshtrade_dot_ledger_dot_transaction_dot_v1_dot_transaction__state__pb2
29
+
30
+
31
+ 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 meshtrade/iam/role/v1/role.proto\x1a%meshtrade/option/v1/method_type.proto\x1a\x37meshtrade/ledger/transaction/v1/transaction_state.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\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\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\xa0\xb5\x18\x01\xaa\xb5\x18\x12\n\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')
32
+
33
+ _globals = globals()
34
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
35
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.ledger.transaction.v1.service_pb2', _globals)
36
+ if not _descriptor._USE_C_DESCRIPTORS:
37
+ _globals['DESCRIPTOR']._loaded_options = None
38
+ _globals['DESCRIPTOR']._serialized_options = b'\n&co.meshtrade.api.ledger.transaction.v1Z@github.com/meshtrade/api/go/ledger/transaction/v1;transaction_v1'
39
+ _globals['_GETTRANSACTIONSTATEREQUEST'].fields_by_name['name']._loaded_options = None
40
+ _globals['_GETTRANSACTIONSTATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H?r:25^transactions/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001$\310\001\001'
41
+ _globals['_MONITORTRANSACTIONSTATEREQUEST'].fields_by_name['name']._loaded_options = None
42
+ _globals['_MONITORTRANSACTIONSTATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H?r:25^transactions/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\230\001$\310\001\001'
43
+ _globals['_TRANSACTIONSERVICE'].methods_by_name['GetTransactionState']._loaded_options = None
44
+ _globals['_TRANSACTIONSERVICE'].methods_by_name['GetTransactionState']._serialized_options = b'\240\265\030\001\252\265\030\022\n\020\300\237\253\003\301\237\253\003\302\237\253\003\303\237\253\003'
45
+ _globals['_TRANSACTIONSERVICE'].methods_by_name['MonitorTransactionState']._loaded_options = None
46
+ _globals['_TRANSACTIONSERVICE'].methods_by_name['MonitorTransactionState']._serialized_options = b'\240\265\030\001\252\265\030\022\n\020\300\237\253\003\301\237\253\003\302\237\253\003\303\237\253\003'
47
+ _globals['_GETTRANSACTIONSTATEREQUEST']._serialized_start=241
48
+ _globals['_GETTRANSACTIONSTATEREQUEST']._serialized_end=357
49
+ _globals['_GETTRANSACTIONSTATERESPONSE']._serialized_start=359
50
+ _globals['_GETTRANSACTIONSTATERESPONSE']._serialized_end=461
51
+ _globals['_MONITORTRANSACTIONSTATEREQUEST']._serialized_start=463
52
+ _globals['_MONITORTRANSACTIONSTATEREQUEST']._serialized_end=583
53
+ _globals['_MONITORTRANSACTIONSTATERESPONSE']._serialized_start=585
54
+ _globals['_MONITORTRANSACTIONSTATERESPONSE']._serialized_end=691
55
+ _globals['_TRANSACTIONSERVICE']._serialized_start=694
56
+ _globals['_TRANSACTIONSERVICE']._serialized_end=1078
57
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,33 @@
1
+ from buf.validate import validate_pb2 as _validate_pb2
2
+ from meshtrade.iam.role.v1 import role_pb2 as _role_pb2
3
+ from meshtrade.option.v1 import method_type_pb2 as _method_type_pb2
4
+ from meshtrade.ledger.transaction.v1 import transaction_state_pb2 as _transaction_state_pb2
5
+ from google.protobuf import descriptor as _descriptor
6
+ from google.protobuf import message as _message
7
+ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
8
+
9
+ DESCRIPTOR: _descriptor.FileDescriptor
10
+
11
+ class GetTransactionStateRequest(_message.Message):
12
+ __slots__ = ("name",)
13
+ NAME_FIELD_NUMBER: _ClassVar[int]
14
+ name: str
15
+ def __init__(self, name: _Optional[str] = ...) -> None: ...
16
+
17
+ class GetTransactionStateResponse(_message.Message):
18
+ __slots__ = ("state",)
19
+ STATE_FIELD_NUMBER: _ClassVar[int]
20
+ state: _transaction_state_pb2.TransactionState
21
+ def __init__(self, state: _Optional[_Union[_transaction_state_pb2.TransactionState, str]] = ...) -> None: ...
22
+
23
+ class MonitorTransactionStateRequest(_message.Message):
24
+ __slots__ = ("name",)
25
+ NAME_FIELD_NUMBER: _ClassVar[int]
26
+ name: str
27
+ def __init__(self, name: _Optional[str] = ...) -> None: ...
28
+
29
+ class MonitorTransactionStateResponse(_message.Message):
30
+ __slots__ = ("state",)
31
+ STATE_FIELD_NUMBER: _ClassVar[int]
32
+ state: _transaction_state_pb2.TransactionState
33
+ 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)
@@ -14,7 +14,7 @@
14
14
 
15
15
  # Generated protobuf imports
16
16
  from .instrument_pb2 import Instrument
17
- from .type_pb2 import InstrumentType
17
+ from .instrument_type_pb2 import InstrumentType
18
18
  from .unit_pb2 import Unit
19
19
 
20
20
  # ===================================================================
@@ -0,0 +1,37 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: meshtrade/studio/instrument/v1/instrument_type.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/studio/instrument/v1/instrument_type.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n4meshtrade/studio/instrument/v1/instrument_type.proto\x12\x1emeshtrade.studio.instrument.v1*\xfc\x06\n\x0eInstrumentType\x12\x1f\n\x1bINSTRUMENT_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15INSTRUMENT_TYPE_OTHER\x10\x01\x12\x19\n\x15INSTRUMENT_TYPE_SHARE\x10\x02\x12$\n INSTRUMENT_TYPE_PREFERENCE_SHARE\x10\x03\x12\x18\n\x14INSTRUMENT_TYPE_BOND\x10\x04\x12\x17\n\x13INSTRUMENT_TYPE_ETF\x10\x05\x12\x17\n\x13INSTRUMENT_TYPE_ETN\x10\x06\x12\x17\n\x13INSTRUMENT_TYPE_AMC\x10\x07\x12\x1e\n\x1aINSTRUMENT_TYPE_UNIT_TRUST\x10\x08\x12#\n\x1fINSTRUMENT_TYPE_CRYPTO_CURRENCY\x10\t\x12!\n\x1dINSTRUMENT_TYPE_FIAT_CURRENCY\x10\n\x12\x1a\n\x16INSTRUMENT_TYPE_RIGHTS\x10\x0b\x12\x18\n\x14INSTRUMENT_TYPE_GOLD\x10\x0c\x12\x1a\n\x16INSTRUMENT_TYPE_SILVER\x10\r\x12\x1c\n\x18INSTRUMENT_TYPE_PLATINUM\x10\x0e\x12\x1d\n\x19INSTRUMENT_TYPE_PALLADIUM\x10\x0f\x12\x1d\n\x19INSTRUMENT_TYPE_CRUDE_OIL\x10\x10\x12\x1f\n\x1bINSTRUMENT_TYPE_NATURAL_GAS\x10\x11\x12\x1a\n\x16INSTRUMENT_TYPE_COPPER\x10\x12\x12\x18\n\x14INSTRUMENT_TYPE_CORN\x10\x13\x12\x19\n\x15INSTRUMENT_TYPE_WHEAT\x10\x14\x12\x1c\n\x18INSTRUMENT_TYPE_SOYBEANS\x10\x15\x12#\n\x1fINSTRUMENT_TYPE_FIAT_STABLECOIN\x10\x16\x12%\n!INSTRUMENT_TYPE_MONEY_MARKET_FUND\x10\x17\x12\x30\n,INSTRUMENT_TYPE_MONEY_MARKET_FUND_STABLECOIN\x10\x18\x12%\n!INSTRUMENT_TYPE_ENDOWMENT_WRAPPER\x10\x19\x12\x18\n\x14INSTRUMENT_TYPE_FUND\x10\x1a\x12#\n\x1fINSTRUMENT_TYPE_FUND_STABLECOIN\x10\x1b\x42g\n%co.meshtrade.api.studio.instrument.v1Z>github.com/meshtrade/api/go/studio/instrument/v1;instrument_v1b\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.studio.instrument.v1.instrument_type_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ _globals['DESCRIPTOR']._loaded_options = None
34
+ _globals['DESCRIPTOR']._serialized_options = b'\n%co.meshtrade.api.studio.instrument.v1Z>github.com/meshtrade/api/go/studio/instrument/v1;instrument_v1'
35
+ _globals['_INSTRUMENTTYPE']._serialized_start=89
36
+ _globals['_INSTRUMENTTYPE']._serialized_end=981
37
+ # @@protoc_insertion_point(module_scope)
@@ -30,7 +30,10 @@ class InstrumentType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
30
30
  INSTRUMENT_TYPE_SOYBEANS: _ClassVar[InstrumentType]
31
31
  INSTRUMENT_TYPE_FIAT_STABLECOIN: _ClassVar[InstrumentType]
32
32
  INSTRUMENT_TYPE_MONEY_MARKET_FUND: _ClassVar[InstrumentType]
33
+ INSTRUMENT_TYPE_MONEY_MARKET_FUND_STABLECOIN: _ClassVar[InstrumentType]
33
34
  INSTRUMENT_TYPE_ENDOWMENT_WRAPPER: _ClassVar[InstrumentType]
35
+ INSTRUMENT_TYPE_FUND: _ClassVar[InstrumentType]
36
+ INSTRUMENT_TYPE_FUND_STABLECOIN: _ClassVar[InstrumentType]
34
37
  INSTRUMENT_TYPE_UNSPECIFIED: InstrumentType
35
38
  INSTRUMENT_TYPE_OTHER: InstrumentType
36
39
  INSTRUMENT_TYPE_SHARE: InstrumentType
@@ -55,4 +58,7 @@ INSTRUMENT_TYPE_WHEAT: InstrumentType
55
58
  INSTRUMENT_TYPE_SOYBEANS: InstrumentType
56
59
  INSTRUMENT_TYPE_FIAT_STABLECOIN: InstrumentType
57
60
  INSTRUMENT_TYPE_MONEY_MARKET_FUND: InstrumentType
61
+ INSTRUMENT_TYPE_MONEY_MARKET_FUND_STABLECOIN: InstrumentType
58
62
  INSTRUMENT_TYPE_ENDOWMENT_WRAPPER: InstrumentType
63
+ INSTRUMENT_TYPE_FUND: InstrumentType
64
+ INSTRUMENT_TYPE_FUND_STABLECOIN: InstrumentType
@@ -20,8 +20,6 @@ from .account_pb2 import (
20
20
  InstrumentMetaData,
21
21
  )
22
22
  from .service_pb2 import (
23
- CloseAccountRequest,
24
- CloseAccountResponse,
25
23
  CreateAccountRequest,
26
24
  GetAccountByNumberRequest,
27
25
  GetAccountRequest,
@@ -69,8 +67,6 @@ __all__ = [
69
67
  "AccountState",
70
68
  "Balance",
71
69
  "ClientOptions",
72
- "CloseAccountRequest",
73
- "CloseAccountResponse",
74
70
  "CreateAccountRequest",
75
71
  "GetAccountByNumberRequest",
76
72
  "GetAccountRequest",
@@ -25,12 +25,12 @@ _sym_db = _symbol_database.Default()
25
25
  from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
26
26
  from meshtrade.type.v1 import ledger_pb2 as meshtrade_dot_type_dot_v1_dot_ledger__pb2
27
27
  from meshtrade.type.v1 import amount_pb2 as meshtrade_dot_type_dot_v1_dot_amount__pb2
28
- from meshtrade.studio.instrument.v1 import type_pb2 as meshtrade_dot_studio_dot_instrument_dot_v1_dot_type__pb2
28
+ from meshtrade.studio.instrument.v1 import instrument_type_pb2 as meshtrade_dot_studio_dot_instrument_dot_v1_dot_instrument__type__pb2
29
29
  from meshtrade.studio.instrument.v1 import unit_pb2 as meshtrade_dot_studio_dot_instrument_dot_v1_dot_unit__pb2
30
30
  from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
31
31
 
32
32
 
33
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)meshtrade/wallet/account/v1/account.proto\x12\x1bmeshtrade.wallet.account.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emeshtrade/type/v1/ledger.proto\x1a\x1emeshtrade/type/v1/amount.proto\x1a)meshtrade/studio/instrument/v1/type.proto\x1a)meshtrade/studio/instrument/v1/unit.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x06\n\x07\x41\x63\x63ount\x12\xc0\x01\n\x04name\x18\x01 \x01(\tB\xab\x01\xbaH\xa7\x01\xba\x01\xa3\x01\n\x14name.format.optional\x12\x35name must be empty or in the format accounts/{ULIDv2}\x1aTsize(this) == 0 || this.matches(\'^accounts/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12\xab\x01\n\x06number\x18\x05 \x01(\tB\x92\x01\xbaH\x8e\x01\xba\x01\x8a\x01\n\x16number.format.optional\x12@number must be empty or a 7-digit account number starting with 1\x1a.size(this) == 0 || this.matches(\'^1[0-9]{6}$\')R\x06number\x12%\n\tledger_id\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x08ledgerId\x12@\n\x06ledger\x18\x07 \x01(\x0e\x32\x19.meshtrade.type.v1.LedgerB\r\xbaH\n\x82\x01\x04\x10\x01 \x00\xc8\x01\x01R\x06ledger\x12\x30\n\x0c\x64isplay_name\x18\x08 \x01(\tB\r\xbaH\nr\x05\x10\x01\x18\xff\x01\xc8\x01\x01R\x0b\x64isplayName\x12O\n\x16live_data_retrieved_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x13liveDataRetrievedAt\x12?\n\x05state\x18\n \x01(\x0e\x32).meshtrade.wallet.account.v1.AccountStateR\x05state\x12@\n\x08\x62\x61lances\x18\x0b \x03(\x0b\x32$.meshtrade.wallet.account.v1.BalanceR\x08\x62\x61lances\"\xa6\x01\n\x12InstrumentMetaData\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x42\n\x04type\x18\x02 \x01(\x0e\x32..meshtrade.studio.instrument.v1.InstrumentTypeR\x04type\x12\x38\n\x04unit\x18\x03 \x01(\x0e\x32$.meshtrade.studio.instrument.v1.UnitR\x04unit\"\x9e\x01\n\x07\x42\x61lance\x12\x31\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x19.meshtrade.type.v1.AmountR\x06\x61mount\x12`\n\x13instrument_metadata\x18\x02 \x01(\x0b\x32/.meshtrade.wallet.account.v1.InstrumentMetaDataR\x12instrumentMetadata*_\n\x0c\x41\x63\x63ountState\x12\x1d\n\x19\x41\x43\x43OUNT_STATE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x41\x43\x43OUNT_STATE_CLOSED\x10\x01\x12\x16\n\x12\x41\x43\x43OUNT_STATE_OPEN\x10\x02\x42^\n\"co.meshtrade.api.wallet.account.v1Z8github.com/meshtrade/api/go/wallet/account/v1;account_v1b\x06proto3')
33
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)meshtrade/wallet/account/v1/account.proto\x12\x1bmeshtrade.wallet.account.v1\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emeshtrade/type/v1/ledger.proto\x1a\x1emeshtrade/type/v1/amount.proto\x1a\x34meshtrade/studio/instrument/v1/instrument_type.proto\x1a)meshtrade/studio/instrument/v1/unit.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x06\n\x07\x41\x63\x63ount\x12\xc0\x01\n\x04name\x18\x01 \x01(\tB\xab\x01\xbaH\xa7\x01\xba\x01\xa3\x01\n\x14name.format.optional\x12\x35name must be empty or in the format accounts/{ULIDv2}\x1aTsize(this) == 0 || this.matches(\'^accounts/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\')R\x04name\x12R\n\x05owner\x18\x02 \x01(\tB<\xbaH9r42/^groups/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$\x98\x01!\xc8\x01\x01R\x05owner\x12\xab\x01\n\x06number\x18\x05 \x01(\tB\x92\x01\xbaH\x8e\x01\xba\x01\x8a\x01\n\x16number.format.optional\x12@number must be empty or a 7-digit account number starting with 1\x1a.size(this) == 0 || this.matches(\'^1[0-9]{6}$\')R\x06number\x12%\n\tledger_id\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\x18\xff\x01R\x08ledgerId\x12@\n\x06ledger\x18\x07 \x01(\x0e\x32\x19.meshtrade.type.v1.LedgerB\r\xbaH\n\x82\x01\x04\x10\x01 \x00\xc8\x01\x01R\x06ledger\x12\x30\n\x0c\x64isplay_name\x18\x08 \x01(\tB\r\xbaH\nr\x05\x10\x01\x18\xff\x01\xc8\x01\x01R\x0b\x64isplayName\x12O\n\x16live_data_retrieved_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x13liveDataRetrievedAt\x12?\n\x05state\x18\n \x01(\x0e\x32).meshtrade.wallet.account.v1.AccountStateR\x05state\x12@\n\x08\x62\x61lances\x18\x0b \x03(\x0b\x32$.meshtrade.wallet.account.v1.BalanceR\x08\x62\x61lances\"\xa6\x01\n\x12InstrumentMetaData\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x42\n\x04type\x18\x02 \x01(\x0e\x32..meshtrade.studio.instrument.v1.InstrumentTypeR\x04type\x12\x38\n\x04unit\x18\x03 \x01(\x0e\x32$.meshtrade.studio.instrument.v1.UnitR\x04unit\"\x9e\x01\n\x07\x42\x61lance\x12\x31\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x19.meshtrade.type.v1.AmountR\x06\x61mount\x12`\n\x13instrument_metadata\x18\x02 \x01(\x0b\x32/.meshtrade.wallet.account.v1.InstrumentMetaDataR\x12instrumentMetadata*_\n\x0c\x41\x63\x63ountState\x12\x1d\n\x19\x41\x43\x43OUNT_STATE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x41\x43\x43OUNT_STATE_CLOSED\x10\x01\x12\x16\n\x12\x41\x43\x43OUNT_STATE_OPEN\x10\x02\x42^\n\"co.meshtrade.api.wallet.account.v1Z8github.com/meshtrade/api/go/wallet/account/v1;account_v1b\x06proto3')
34
34
 
35
35
  _globals = globals()
36
36
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -50,12 +50,12 @@ if not _descriptor._USE_C_DESCRIPTORS:
50
50
  _globals['_ACCOUNT'].fields_by_name['ledger']._serialized_options = b'\272H\n\202\001\004\020\001 \000\310\001\001'
51
51
  _globals['_ACCOUNT'].fields_by_name['display_name']._loaded_options = None
52
52
  _globals['_ACCOUNT'].fields_by_name['display_name']._serialized_options = b'\272H\nr\005\020\001\030\377\001\310\001\001'
53
- _globals['_ACCOUNTSTATE']._serialized_start=1448
54
- _globals['_ACCOUNTSTATE']._serialized_end=1543
55
- _globals['_ACCOUNT']._serialized_start=287
56
- _globals['_ACCOUNT']._serialized_end=1116
57
- _globals['_INSTRUMENTMETADATA']._serialized_start=1119
58
- _globals['_INSTRUMENTMETADATA']._serialized_end=1285
59
- _globals['_BALANCE']._serialized_start=1288
60
- _globals['_BALANCE']._serialized_end=1446
53
+ _globals['_ACCOUNTSTATE']._serialized_start=1459
54
+ _globals['_ACCOUNTSTATE']._serialized_end=1554
55
+ _globals['_ACCOUNT']._serialized_start=298
56
+ _globals['_ACCOUNT']._serialized_end=1127
57
+ _globals['_INSTRUMENTMETADATA']._serialized_start=1130
58
+ _globals['_INSTRUMENTMETADATA']._serialized_end=1296
59
+ _globals['_BALANCE']._serialized_start=1299
60
+ _globals['_BALANCE']._serialized_end=1457
61
61
  # @@protoc_insertion_point(module_scope)
@@ -3,7 +3,7 @@ import datetime
3
3
  from buf.validate import validate_pb2 as _validate_pb2
4
4
  from meshtrade.type.v1 import ledger_pb2 as _ledger_pb2
5
5
  from meshtrade.type.v1 import amount_pb2 as _amount_pb2
6
- from meshtrade.studio.instrument.v1 import type_pb2 as _type_pb2
6
+ from meshtrade.studio.instrument.v1 import instrument_type_pb2 as _instrument_type_pb2
7
7
  from meshtrade.studio.instrument.v1 import unit_pb2 as _unit_pb2
8
8
  from google.protobuf import timestamp_pb2 as _timestamp_pb2
9
9
  from google.protobuf.internal import containers as _containers
@@ -52,9 +52,9 @@ class InstrumentMetaData(_message.Message):
52
52
  TYPE_FIELD_NUMBER: _ClassVar[int]
53
53
  UNIT_FIELD_NUMBER: _ClassVar[int]
54
54
  name: str
55
- type: _type_pb2.InstrumentType
55
+ type: _instrument_type_pb2.InstrumentType
56
56
  unit: _unit_pb2.Unit
57
- def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[_type_pb2.InstrumentType, str]] = ..., unit: _Optional[_Union[_unit_pb2.Unit, str]] = ...) -> None: ...
57
+ def __init__(self, name: _Optional[str] = ..., type: _Optional[_Union[_instrument_type_pb2.InstrumentType, str]] = ..., unit: _Optional[_Union[_unit_pb2.Unit, str]] = ...) -> None: ...
58
58
 
59
59
  class Balance(_message.Message):
60
60
  __slots__ = ("amount", "instrument_metadata")
@@ -18,8 +18,6 @@ from meshtrade.iam.api_user.v1.api_credentials import find_credentials
18
18
  from .account_pb2 import Account
19
19
  from .service_options_meshpy import ServiceOptions
20
20
  from .service_pb2 import (
21
- CloseAccountRequest,
22
- CloseAccountResponse,
23
21
  CreateAccountRequest,
24
22
  GetAccountByNumberRequest,
25
23
  GetAccountRequest,
@@ -188,22 +186,6 @@ class AccountService(BaseGRPCClient):
188
186
  """
189
187
  return self._execute_method("OpenAccount", request, timeout)
190
188
 
191
- def close_account(self, request: CloseAccountRequest, timeout: Optional[timedelta] = None) -> CloseAccountResponse:
192
- """CloseAccount method.
193
-
194
- Args:
195
- request: The CloseAccount request message
196
- timeout: Optional timeout override for this call
197
-
198
- Returns:
199
- The CloseAccount response message
200
-
201
- Raises:
202
- grpc.RpcError: If the gRPC call fails
203
- ValueError: If authentication credentials are missing
204
- """
205
- return self._execute_method("CloseAccount", request, timeout)
206
-
207
189
  def get_account(self, request: GetAccountRequest, timeout: Optional[timedelta] = None) -> Account:
208
190
  """GetAccount method.
209
191