Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions python/ccxt/async_support/bitmart.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
from ccxt.base.decimal_to_precision import TICK_SIZE
from ccxt.base.precise import Precise

_TRANSFER_TYPE_MAP = {
'contract_to_spot': 'spot',
'spot_to_contract': 'swap',
}


class bitmart(Exchange, ImplicitAPI):

Expand Down Expand Up @@ -4223,11 +4228,8 @@ def parse_transfer_status(self, status: Str) -> Str:
return self.safe_string(statuses, status, status)

def parse_transfer_to_account(self, type):
types: dict = {
'contract_to_spot': 'spot',
'spot_to_contract': 'swap',
}
return self.safe_string(types, type, type)
# Reference static map instead of recreating dict every call
return self.safe_string(_TRANSFER_TYPE_MAP, type, type)

def parse_transfer_from_account(self, type):
types: dict = {
Expand Down
Loading