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.
- bitget/ccxt/__init__.py +2 -1
- bitget/ccxt/abstract/bitget.py +6 -0
- bitget/ccxt/async_support/__init__.py +2 -1
- bitget/ccxt/async_support/base/exchange.py +1 -1
- bitget/ccxt/async_support/bitget.py +2032 -559
- bitget/ccxt/base/decimal_to_precision.py +7 -9
- bitget/ccxt/base/errors.py +6 -6
- bitget/ccxt/base/exchange.py +1 -1
- bitget/ccxt/bitget.py +2032 -559
- bitget/ccxt/pro/__init__.py +2 -1
- bitget/ccxt/pro/bitget.py +3 -3
- {bitget-0.0.78.dist-info → bitget-0.0.80.dist-info}/METADATA +11 -1
- {bitget-0.0.78.dist-info → bitget-0.0.80.dist-info}/RECORD +14 -14
- {bitget-0.0.78.dist-info → bitget-0.0.80.dist-info}/WHEEL +0 -0
@@ -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,
|
37
|
-
assert
|
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(
|
40
|
-
|
41
|
-
assert isinstance(
|
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
|
44
|
+
assert precision > 0, 'negative or zero precision can not be used with TICK_SIZE precisionMode'
|
45
45
|
else:
|
46
|
-
assert isinstance(
|
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:
|
bitget/ccxt/base/errors.py
CHANGED
@@ -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',
|