Skip to content

Commit 2e0de16

Browse files
aarmoaAbel Armoa
authored andcommitted
(feat) Refactor Composer to use actual markets and tokens to translate human-readable values into chain format
1 parent 2dad929 commit 2e0de16

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

pyinjective/constant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from configparser import ConfigParser
3+
from warnings import warn
34

45
MAX_CLIENT_ID_LENGTH = 128
56
MAX_DATA_SIZE = 256

pyinjective/proto/exchange/injective_derivative_exchange_rpc_pb2_grpc.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, channel):
2222
response_deserializer=exchange_dot_injective__derivative__exchange__rpc__pb2.MarketsResponse.FromString,
2323
)
2424
self.Market = channel.unary_unary(
25-
'/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/Market',
25+
'/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/SpotMarket',
2626
request_serializer=exchange_dot_injective__derivative__exchange__rpc__pb2.MarketRequest.SerializeToString,
2727
response_deserializer=exchange_dot_injective__derivative__exchange__rpc__pb2.MarketResponse.FromString,
2828
)
@@ -156,7 +156,7 @@ def Markets(self, request, context):
156156
raise NotImplementedError('Method not implemented!')
157157

158158
def Market(self, request, context):
159-
"""Market gets details of a single derivative market
159+
"""SpotMarket gets details of a single derivative market
160160
"""
161161
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
162162
context.set_details('Method not implemented!')
@@ -184,14 +184,14 @@ def BinaryOptionsMarket(self, request, context):
184184
raise NotImplementedError('Method not implemented!')
185185

186186
def Orderbook(self, request, context):
187-
"""Orderbook gets the Orderbook of a Derivative Market
187+
"""Orderbook gets the Orderbook of a Derivative SpotMarket
188188
"""
189189
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
190190
context.set_details('Method not implemented!')
191191
raise NotImplementedError('Method not implemented!')
192192

193193
def OrderbookV2(self, request, context):
194-
"""Orderbook gets the Orderbook of a Derivative Market
194+
"""Orderbook gets the Orderbook of a Derivative SpotMarket
195195
"""
196196
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
197197
context.set_details('Method not implemented!')
@@ -233,7 +233,7 @@ def StreamOrderbookUpdate(self, request, context):
233233
raise NotImplementedError('Method not implemented!')
234234

235235
def Orders(self, request, context):
236-
"""DerivativeLimitOrders gets the limit orders of a derivative Market.
236+
"""DerivativeLimitOrders gets the limit orders of a derivative SpotMarket.
237237
"""
238238
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
239239
context.set_details('Method not implemented!')
@@ -275,21 +275,21 @@ def StreamPositions(self, request, context):
275275
raise NotImplementedError('Method not implemented!')
276276

277277
def StreamOrders(self, request, context):
278-
"""StreamOrders streams updates to individual orders of a Derivative Market.
278+
"""StreamOrders streams updates to individual orders of a Derivative SpotMarket.
279279
"""
280280
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
281281
context.set_details('Method not implemented!')
282282
raise NotImplementedError('Method not implemented!')
283283

284284
def Trades(self, request, context):
285-
"""Trades gets the trades of a Derivative Market.
285+
"""Trades gets the trades of a Derivative SpotMarket.
286286
"""
287287
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
288288
context.set_details('Method not implemented!')
289289
raise NotImplementedError('Method not implemented!')
290290

291291
def StreamTrades(self, request, context):
292-
"""StreamTrades streams newly executed trades from Derivative Market.
292+
"""StreamTrades streams newly executed trades from Derivative SpotMarket.
293293
"""
294294
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
295295
context.set_details('Method not implemented!')
@@ -318,7 +318,7 @@ def OrdersHistory(self, request, context):
318318
raise NotImplementedError('Method not implemented!')
319319

320320
def StreamOrdersHistory(self, request, context):
321-
"""Stream updates to historical orders of a derivative Market
321+
"""Stream updates to historical orders of a derivative SpotMarket
322322
"""
323323
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
324324
context.set_details('Method not implemented!')
@@ -332,8 +332,8 @@ def add_InjectiveDerivativeExchangeRPCServicer_to_server(servicer, server):
332332
request_deserializer=exchange_dot_injective__derivative__exchange__rpc__pb2.MarketsRequest.FromString,
333333
response_serializer=exchange_dot_injective__derivative__exchange__rpc__pb2.MarketsResponse.SerializeToString,
334334
),
335-
'Market': grpc.unary_unary_rpc_method_handler(
336-
servicer.Market,
335+
'SpotMarket': grpc.unary_unary_rpc_method_handler(
336+
servicer.SpotMarket,
337337
request_deserializer=exchange_dot_injective__derivative__exchange__rpc__pb2.MarketRequest.FromString,
338338
response_serializer=exchange_dot_injective__derivative__exchange__rpc__pb2.MarketResponse.SerializeToString,
339339
),
@@ -492,7 +492,7 @@ def Market(request,
492492
wait_for_ready=None,
493493
timeout=None,
494494
metadata=None):
495-
return grpc.experimental.unary_unary(request, target, '/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/Market',
495+
return grpc.experimental.unary_unary(request, target, '/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/SpotMarket',
496496
exchange_dot_injective__derivative__exchange__rpc__pb2.MarketRequest.SerializeToString,
497497
exchange_dot_injective__derivative__exchange__rpc__pb2.MarketResponse.FromString,
498498
options, channel_credentials,

pyinjective/proto/exchange/injective_spot_exchange_rpc_pb2_grpc.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, channel):
2121
response_deserializer=exchange_dot_injective__spot__exchange__rpc__pb2.MarketsResponse.FromString,
2222
)
2323
self.Market = channel.unary_unary(
24-
'/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/Market',
24+
'/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/SpotMarket',
2525
request_serializer=exchange_dot_injective__spot__exchange__rpc__pb2.MarketRequest.SerializeToString,
2626
response_deserializer=exchange_dot_injective__spot__exchange__rpc__pb2.MarketResponse.FromString,
2727
)
@@ -133,14 +133,14 @@ def StreamMarkets(self, request, context):
133133
raise NotImplementedError('Method not implemented!')
134134

135135
def Orderbook(self, request, context):
136-
"""Orderbook of a Spot Market
136+
"""Orderbook of a Spot SpotMarket
137137
"""
138138
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
139139
context.set_details('Method not implemented!')
140140
raise NotImplementedError('Method not implemented!')
141141

142142
def OrderbookV2(self, request, context):
143-
"""Orderbook of a Spot Market
143+
"""Orderbook of a Spot SpotMarket
144144
"""
145145
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
146146
context.set_details('Method not implemented!')
@@ -182,28 +182,28 @@ def StreamOrderbookUpdate(self, request, context):
182182
raise NotImplementedError('Method not implemented!')
183183

184184
def Orders(self, request, context):
185-
"""Orders of a Spot Market
185+
"""Orders of a Spot SpotMarket
186186
"""
187187
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
188188
context.set_details('Method not implemented!')
189189
raise NotImplementedError('Method not implemented!')
190190

191191
def StreamOrders(self, request, context):
192-
"""Stream updates to individual orders of a Spot Market
192+
"""Stream updates to individual orders of a Spot SpotMarket
193193
"""
194194
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
195195
context.set_details('Method not implemented!')
196196
raise NotImplementedError('Method not implemented!')
197197

198198
def Trades(self, request, context):
199-
"""Trades of a Spot Market
199+
"""Trades of a Spot SpotMarket
200200
"""
201201
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
202202
context.set_details('Method not implemented!')
203203
raise NotImplementedError('Method not implemented!')
204204

205205
def StreamTrades(self, request, context):
206-
"""Stream newly executed trades from Spot Market
206+
"""Stream newly executed trades from Spot SpotMarket
207207
"""
208208
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
209209
context.set_details('Method not implemented!')
@@ -231,7 +231,7 @@ def OrdersHistory(self, request, context):
231231
raise NotImplementedError('Method not implemented!')
232232

233233
def StreamOrdersHistory(self, request, context):
234-
"""Stream updates to historical orders of a spot Market
234+
"""Stream updates to historical orders of a spot SpotMarket
235235
"""
236236
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
237237
context.set_details('Method not implemented!')
@@ -245,8 +245,8 @@ def add_InjectiveSpotExchangeRPCServicer_to_server(servicer, server):
245245
request_deserializer=exchange_dot_injective__spot__exchange__rpc__pb2.MarketsRequest.FromString,
246246
response_serializer=exchange_dot_injective__spot__exchange__rpc__pb2.MarketsResponse.SerializeToString,
247247
),
248-
'Market': grpc.unary_unary_rpc_method_handler(
249-
servicer.Market,
248+
'SpotMarket': grpc.unary_unary_rpc_method_handler(
249+
servicer.SpotMarket,
250250
request_deserializer=exchange_dot_injective__spot__exchange__rpc__pb2.MarketRequest.FromString,
251251
response_serializer=exchange_dot_injective__spot__exchange__rpc__pb2.MarketResponse.SerializeToString,
252252
),
@@ -369,7 +369,7 @@ def Market(request,
369369
wait_for_ready=None,
370370
timeout=None,
371371
metadata=None):
372-
return grpc.experimental.unary_unary(request, target, '/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/Market',
372+
return grpc.experimental.unary_unary(request, target, '/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/SpotMarket',
373373
exchange_dot_injective__spot__exchange__rpc__pb2.MarketRequest.SerializeToString,
374374
exchange_dot_injective__spot__exchange__rpc__pb2.MarketResponse.FromString,
375375
options, channel_credentials,

0 commit comments

Comments
 (0)