(self, order, structureType)
| 2071 | return int(x) |
| 2072 | |
| 2073 | def eip_message_for_order(self, order, structureType): |
| 2074 | priceMultiplier = '1000000000' |
| 2075 | orderLegs = self.safe_list(order, 'legs', []) |
| 2076 | legs = [] |
| 2077 | for i in range(0, len(orderLegs)): |
| 2078 | leg = orderLegs[i] |
| 2079 | market = self.market(leg['instrument']) |
| 2080 | bigInt10 = self.convert_to_big_int_custom('10') |
| 2081 | precisionValue = self.precision_from_string(self.safe_string(market['precision'], 'base')) |
| 2082 | precisionValueStr = str(precisionValue) |
| 2083 | sizeMultiplier = math.pow(bigInt10, self.convert_to_big_int_custom(precisionValueStr)) |
| 2084 | size = leg['size'] |
| 2085 | sizeParts = size.split('.') |
| 2086 | sizeDec = self.safe_string(sizeParts, 1, '') |
| 2087 | sizeDecLength = len(sizeDec) + 0 # php tr |
| 2088 | sizeDecLengthStr = str(sizeDecLength) |
| 2089 | sizeInteger = self.convert_to_big_int_custom(size.replace('.', '')) * sizeMultiplier / (math.pow(bigInt10, self.convert_to_big_int_custom(sizeDecLengthStr))) |
| 2090 | legOrder = { |
| 2091 | 'assetID': market['info']['instrument_hash'], |
| 2092 | 'contractSize': self.parse_to_int(sizeInteger), |
| 2093 | 'isBuyingContract': leg['is_buying_asset'], |
| 2094 | } |
| 2095 | limitPrice = self.safe_string(leg, 'limit_price') |
| 2096 | if self.omit_zero(limitPrice) is not None: |
| 2097 | price = leg['limit_price'] |
| 2098 | limitParts = price.split('.') |
| 2099 | limitDec = self.safe_string(limitParts, 1, '') |
| 2100 | limitDecLength = len(limitDec) + 0 # php tr |
| 2101 | limitDecLengthStr = str(limitDecLength) |
| 2102 | powerNum = limitDecLengthStr == 0 if '0' else self.convert_to_big_int_custom(limitDecLengthStr) |
| 2103 | priceInteger = (self.convert_to_big_int_custom(price.replace('.', '')) * self.convert_to_big_int_custom(priceMultiplier) / (math.pow(bigInt10, powerNum))) |
| 2104 | legOrder['limitPrice'] = self.parse_to_int(priceInteger) |
| 2105 | else: |
| 2106 | legOrder['limitPrice'] = 0 # should be zero to validate type-check |
| 2107 | legs.append(legOrder) |
| 2108 | returnValue = { |
| 2109 | 'subAccountID': order['sub_account_id'], |
| 2110 | 'isMarket': order['is_market'], |
| 2111 | 'timeInForce': self.time_in_force_to_int(order['time_in_force']), |
| 2112 | 'postOnly': order['post_only'], |
| 2113 | 'reduceOnly': order['reduce_only'], |
| 2114 | 'legs': legs, |
| 2115 | 'nonce': order['signature']['nonce'], |
| 2116 | 'expiration': order['signature']['expiration'], |
| 2117 | } |
| 2118 | if structureType == 'EIP712_ORDER_WITH_BUILDER_TYPE' and self.safe_bool(self.options, 'builderFee', True): |
| 2119 | returnValue['builder'] = order['builder'] |
| 2120 | returnValue['builderFee'] = self.parse_to_int(self.convert_to_big_int_custom(self.fee_amount_multiplier()) * float(order['builder_fee'])) # the order is matter for Multiply in go, b must be float64 otherwise the value would be 0 |
| 2121 | return returnValue |
| 2122 | |
| 2123 | def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}): |
| 2124 | """ |
no test coverage detected