bitget 0.0.78__py3-none-any.whl → 0.0.80__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.
@@ -33,25 +33,23 @@ NO_PADDING = 5
33
33
  PAD_WITH_ZERO = 6
34
34
 
35
35
 
36
- def decimal_to_precision(n, rounding_mode=ROUND, numPrecisionDigits=None, counting_mode=DECIMAL_PLACES, padding_mode=NO_PADDING):
37
- assert numPrecisionDigits is not None, 'numPrecisionDigits should not be None'
36
+ def decimal_to_precision(n, rounding_mode=ROUND, precision=None, counting_mode=DECIMAL_PLACES, padding_mode=NO_PADDING):
37
+ assert precision is not None, 'precision should not be None'
38
38
 
39
- if isinstance(numPrecisionDigits, str):
40
- numPrecisionDigits = float(numPrecisionDigits)
41
- assert isinstance(numPrecisionDigits, float) or isinstance(numPrecisionDigits, decimal.Decimal) or isinstance(numPrecisionDigits, numbers.Integral), 'numPrecisionDigits has an invalid number'
39
+ if isinstance(precision, str):
40
+ precision = float(precision)
41
+ assert isinstance(precision, float) or isinstance(precision, decimal.Decimal) or isinstance(precision, numbers.Integral), 'precision has an invalid number'
42
42
 
43
43
  if counting_mode == TICK_SIZE:
44
- assert numPrecisionDigits > 0, 'negative or zero numPrecisionDigits can not be used with TICK_SIZE precisionMode'
44
+ assert precision > 0, 'negative or zero precision can not be used with TICK_SIZE precisionMode'
45
45
  else:
46
- assert isinstance(numPrecisionDigits, numbers.Integral)
46
+ assert isinstance(precision, numbers.Integral)
47
47
 
48
48
  assert rounding_mode in [TRUNCATE, ROUND]
49
49
  assert counting_mode in [DECIMAL_PLACES, SIGNIFICANT_DIGITS, TICK_SIZE]
50
50
  assert padding_mode in [NO_PADDING, PAD_WITH_ZERO]
51
51
  # end of checks
52
52
 
53
- precision = numPrecisionDigits # "precision" variable name was in signature, but to make function signature similar to php/js, I had to change the argument name to "numPrecisionDigits". however, the below codes use "precision" variable name, so we have to assign that name here (you can change the usage of 'precision' variable name below everywhere, but i've refrained to do that to avoid many changes)
54
-
55
53
  context = decimal.getcontext()
56
54
 
57
55
  if counting_mode != TICK_SIZE:
@@ -1,9 +1,3 @@
1
- # ----------------------------------------------------------------------------
2
-
3
- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
- # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
- # EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
-
7
1
  error_hierarchy = {
8
2
  'BaseError': {
9
3
  'ExchangeError': {
@@ -23,6 +17,7 @@ error_hierarchy = {
23
17
  },
24
18
  'MarketClosed': {},
25
19
  'ManualInteractionNeeded': {},
20
+ 'RestrictedLocation': {},
26
21
  },
27
22
  'InsufficientFunds': {},
28
23
  'InvalidAddress': {
@@ -118,6 +113,10 @@ class ManualInteractionNeeded(OperationRejected):
118
113
  pass
119
114
 
120
115
 
116
+ class RestrictedLocation(OperationRejected):
117
+ pass
118
+
119
+
121
120
  class InsufficientFunds(ExchangeError):
122
121
  pass
123
122
 
@@ -238,6 +237,7 @@ __all__ = [
238
237
  'MarginModeAlreadySet',
239
238
  'MarketClosed',
240
239
  'ManualInteractionNeeded',
240
+ 'RestrictedLocation',
241
241
  'InsufficientFunds',
242
242
  'InvalidAddress',
243
243
  'AddressPending',
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.97'
7
+ __version__ = '4.4.99'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10