MCPcopy Create free account
hub / github.com/ccxt/ccxt / fix_stringified_json_members

Method fix_stringified_json_members

python/ccxt/base/exchange.py:2050–2058  ·  view source on GitHub ↗
(self, content)

Source from the content-addressed store, hash-verified

2048 return re.sub('(?!^)([A-Z]+)', r'_\1', str).lower()
2049
2050 def fix_stringified_json_members(self, content):
2051 # when stringified json has members with their values also stringified, like:
2052 # '{"code":0, "data":{"order":{"orderId":1742968678528512345,"symbol":"BTC-USDT", "takeProfit":"{\"type\":\"TAKE_PROFIT\",\"stopPrice\":43320.1}","reduceOnly":false}}}'
2053 # we can fix with below manipulations
2054 # @ts-ignore
2055 modifiedContent = content.replace('\\', '')
2056 modifiedContent = modifiedContent.replace('"{', '{')
2057 modifiedContent = modifiedContent.replace('}"', '}')
2058 return modifiedContent
2059
2060 def extend_exchange_options(self, newOptions):
2061 self.options = self.extend(self.options, newOptions)

Callers 6

create_orderMethod · 0.80
create_ordersMethod · 0.80
handle_errorsMethod · 0.80
create_orderMethod · 0.80
create_ordersMethod · 0.80
handle_errorsMethod · 0.80

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected