coinex-api 0.0.7__py3-none-any.whl → 0.0.8__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.
- {coinex_api-0.0.7.dist-info → coinex_api-0.0.8.dist-info}/METADATA +33 -14
- coinex_api-0.0.8.dist-info/RECORD +3 -0
- coinex_api/__init__.py +0 -7
- coinex_api/ccxt/__init__.py +0 -101
- coinex_api/ccxt/abstract/coinex.py +0 -237
- coinex_api/ccxt/async_support/__init__.py +0 -80
- coinex_api/ccxt/async_support/base/__init__.py +0 -1
- coinex_api/ccxt/async_support/base/exchange.py +0 -2100
- coinex_api/ccxt/async_support/base/throttler.py +0 -50
- coinex_api/ccxt/async_support/base/ws/__init__.py +0 -38
- coinex_api/ccxt/async_support/base/ws/aiohttp_client.py +0 -147
- coinex_api/ccxt/async_support/base/ws/cache.py +0 -213
- coinex_api/ccxt/async_support/base/ws/client.py +0 -214
- coinex_api/ccxt/async_support/base/ws/fast_client.py +0 -97
- coinex_api/ccxt/async_support/base/ws/functions.py +0 -59
- coinex_api/ccxt/async_support/base/ws/future.py +0 -69
- coinex_api/ccxt/async_support/base/ws/order_book.py +0 -78
- coinex_api/ccxt/async_support/base/ws/order_book_side.py +0 -174
- coinex_api/ccxt/async_support/coinex.py +0 -5833
- coinex_api/ccxt/base/__init__.py +0 -27
- coinex_api/ccxt/base/decimal_to_precision.py +0 -174
- coinex_api/ccxt/base/errors.py +0 -267
- coinex_api/ccxt/base/exchange.py +0 -6770
- coinex_api/ccxt/base/precise.py +0 -297
- coinex_api/ccxt/base/types.py +0 -577
- coinex_api/ccxt/coinex.py +0 -5832
- coinex_api/ccxt/pro/__init__.py +0 -21
- coinex_api/ccxt/pro/coinex.py +0 -1366
- coinex_api/ccxt/static_dependencies/README.md +0 -1
- coinex_api/ccxt/static_dependencies/__init__.py +0 -1
- coinex_api/ccxt/static_dependencies/ecdsa/__init__.py +0 -14
- coinex_api/ccxt/static_dependencies/ecdsa/_version.py +0 -520
- coinex_api/ccxt/static_dependencies/ecdsa/curves.py +0 -56
- coinex_api/ccxt/static_dependencies/ecdsa/der.py +0 -221
- coinex_api/ccxt/static_dependencies/ecdsa/ecdsa.py +0 -310
- coinex_api/ccxt/static_dependencies/ecdsa/ellipticcurve.py +0 -197
- coinex_api/ccxt/static_dependencies/ecdsa/keys.py +0 -332
- coinex_api/ccxt/static_dependencies/ecdsa/numbertheory.py +0 -531
- coinex_api/ccxt/static_dependencies/ecdsa/rfc6979.py +0 -100
- coinex_api/ccxt/static_dependencies/ecdsa/util.py +0 -266
- coinex_api/ccxt/static_dependencies/ethereum/__init__.py +0 -7
- coinex_api/ccxt/static_dependencies/ethereum/abi/__init__.py +0 -16
- coinex_api/ccxt/static_dependencies/ethereum/abi/abi.py +0 -19
- coinex_api/ccxt/static_dependencies/ethereum/abi/base.py +0 -152
- coinex_api/ccxt/static_dependencies/ethereum/abi/codec.py +0 -217
- coinex_api/ccxt/static_dependencies/ethereum/abi/constants.py +0 -3
- coinex_api/ccxt/static_dependencies/ethereum/abi/decoding.py +0 -565
- coinex_api/ccxt/static_dependencies/ethereum/abi/encoding.py +0 -720
- coinex_api/ccxt/static_dependencies/ethereum/abi/exceptions.py +0 -139
- coinex_api/ccxt/static_dependencies/ethereum/abi/grammar.py +0 -443
- coinex_api/ccxt/static_dependencies/ethereum/abi/packed.py +0 -13
- coinex_api/ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/ethereum/abi/registry.py +0 -643
- coinex_api/ccxt/static_dependencies/ethereum/abi/tools/__init__.py +0 -3
- coinex_api/ccxt/static_dependencies/ethereum/abi/tools/_strategies.py +0 -230
- coinex_api/ccxt/static_dependencies/ethereum/abi/utils/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/ethereum/abi/utils/numeric.py +0 -83
- coinex_api/ccxt/static_dependencies/ethereum/abi/utils/padding.py +0 -27
- coinex_api/ccxt/static_dependencies/ethereum/abi/utils/string.py +0 -19
- coinex_api/ccxt/static_dependencies/ethereum/account/__init__.py +0 -3
- coinex_api/ccxt/static_dependencies/ethereum/account/encode_typed_data/__init__.py +0 -4
- coinex_api/ccxt/static_dependencies/ethereum/account/encode_typed_data/encoding_and_hashing.py +0 -239
- coinex_api/ccxt/static_dependencies/ethereum/account/encode_typed_data/helpers.py +0 -40
- coinex_api/ccxt/static_dependencies/ethereum/account/messages.py +0 -263
- coinex_api/ccxt/static_dependencies/ethereum/account/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/ethereum/hexbytes/__init__.py +0 -5
- coinex_api/ccxt/static_dependencies/ethereum/hexbytes/_utils.py +0 -54
- coinex_api/ccxt/static_dependencies/ethereum/hexbytes/main.py +0 -65
- coinex_api/ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/ethereum/typing/__init__.py +0 -63
- coinex_api/ccxt/static_dependencies/ethereum/typing/abi.py +0 -6
- coinex_api/ccxt/static_dependencies/ethereum/typing/bls.py +0 -7
- coinex_api/ccxt/static_dependencies/ethereum/typing/discovery.py +0 -5
- coinex_api/ccxt/static_dependencies/ethereum/typing/encoding.py +0 -7
- coinex_api/ccxt/static_dependencies/ethereum/typing/enums.py +0 -17
- coinex_api/ccxt/static_dependencies/ethereum/typing/ethpm.py +0 -9
- coinex_api/ccxt/static_dependencies/ethereum/typing/evm.py +0 -20
- coinex_api/ccxt/static_dependencies/ethereum/typing/networks.py +0 -1122
- coinex_api/ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/ethereum/utils/__init__.py +0 -115
- coinex_api/ccxt/static_dependencies/ethereum/utils/abi.py +0 -72
- coinex_api/ccxt/static_dependencies/ethereum/utils/address.py +0 -171
- coinex_api/ccxt/static_dependencies/ethereum/utils/applicators.py +0 -151
- coinex_api/ccxt/static_dependencies/ethereum/utils/conversions.py +0 -190
- coinex_api/ccxt/static_dependencies/ethereum/utils/currency.py +0 -107
- coinex_api/ccxt/static_dependencies/ethereum/utils/curried/__init__.py +0 -269
- coinex_api/ccxt/static_dependencies/ethereum/utils/debug.py +0 -20
- coinex_api/ccxt/static_dependencies/ethereum/utils/decorators.py +0 -132
- coinex_api/ccxt/static_dependencies/ethereum/utils/encoding.py +0 -6
- coinex_api/ccxt/static_dependencies/ethereum/utils/exceptions.py +0 -4
- coinex_api/ccxt/static_dependencies/ethereum/utils/functional.py +0 -75
- coinex_api/ccxt/static_dependencies/ethereum/utils/hexadecimal.py +0 -74
- coinex_api/ccxt/static_dependencies/ethereum/utils/humanize.py +0 -188
- coinex_api/ccxt/static_dependencies/ethereum/utils/logging.py +0 -159
- coinex_api/ccxt/static_dependencies/ethereum/utils/module_loading.py +0 -31
- coinex_api/ccxt/static_dependencies/ethereum/utils/numeric.py +0 -43
- coinex_api/ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/ethereum/utils/toolz.py +0 -76
- coinex_api/ccxt/static_dependencies/ethereum/utils/types.py +0 -54
- coinex_api/ccxt/static_dependencies/ethereum/utils/typing/__init__.py +0 -18
- coinex_api/ccxt/static_dependencies/ethereum/utils/typing/misc.py +0 -14
- coinex_api/ccxt/static_dependencies/ethereum/utils/units.py +0 -31
- coinex_api/ccxt/static_dependencies/keccak/__init__.py +0 -3
- coinex_api/ccxt/static_dependencies/keccak/keccak.py +0 -197
- coinex_api/ccxt/static_dependencies/lark/__init__.py +0 -38
- coinex_api/ccxt/static_dependencies/lark/__pyinstaller/__init__.py +0 -6
- coinex_api/ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +0 -14
- coinex_api/ccxt/static_dependencies/lark/ast_utils.py +0 -59
- coinex_api/ccxt/static_dependencies/lark/common.py +0 -86
- coinex_api/ccxt/static_dependencies/lark/exceptions.py +0 -292
- coinex_api/ccxt/static_dependencies/lark/grammar.py +0 -130
- coinex_api/ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/lark/grammars/common.lark +0 -59
- coinex_api/ccxt/static_dependencies/lark/grammars/lark.lark +0 -62
- coinex_api/ccxt/static_dependencies/lark/grammars/python.lark +0 -302
- coinex_api/ccxt/static_dependencies/lark/grammars/unicode.lark +0 -7
- coinex_api/ccxt/static_dependencies/lark/indenter.py +0 -143
- coinex_api/ccxt/static_dependencies/lark/lark.py +0 -658
- coinex_api/ccxt/static_dependencies/lark/lexer.py +0 -678
- coinex_api/ccxt/static_dependencies/lark/load_grammar.py +0 -1428
- coinex_api/ccxt/static_dependencies/lark/parse_tree_builder.py +0 -391
- coinex_api/ccxt/static_dependencies/lark/parser_frontends.py +0 -257
- coinex_api/ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/lark/parsers/cyk.py +0 -340
- coinex_api/ccxt/static_dependencies/lark/parsers/earley.py +0 -314
- coinex_api/ccxt/static_dependencies/lark/parsers/earley_common.py +0 -42
- coinex_api/ccxt/static_dependencies/lark/parsers/earley_forest.py +0 -801
- coinex_api/ccxt/static_dependencies/lark/parsers/grammar_analysis.py +0 -203
- coinex_api/ccxt/static_dependencies/lark/parsers/lalr_analysis.py +0 -332
- coinex_api/ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +0 -158
- coinex_api/ccxt/static_dependencies/lark/parsers/lalr_parser.py +0 -122
- coinex_api/ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +0 -110
- coinex_api/ccxt/static_dependencies/lark/parsers/xearley.py +0 -165
- coinex_api/ccxt/static_dependencies/lark/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/lark/reconstruct.py +0 -107
- coinex_api/ccxt/static_dependencies/lark/tools/__init__.py +0 -70
- coinex_api/ccxt/static_dependencies/lark/tools/nearley.py +0 -202
- coinex_api/ccxt/static_dependencies/lark/tools/serialize.py +0 -32
- coinex_api/ccxt/static_dependencies/lark/tools/standalone.py +0 -196
- coinex_api/ccxt/static_dependencies/lark/tree.py +0 -267
- coinex_api/ccxt/static_dependencies/lark/tree_matcher.py +0 -186
- coinex_api/ccxt/static_dependencies/lark/tree_templates.py +0 -180
- coinex_api/ccxt/static_dependencies/lark/utils.py +0 -343
- coinex_api/ccxt/static_dependencies/lark/visitors.py +0 -596
- coinex_api/ccxt/static_dependencies/marshmallow/__init__.py +0 -81
- coinex_api/ccxt/static_dependencies/marshmallow/base.py +0 -65
- coinex_api/ccxt/static_dependencies/marshmallow/class_registry.py +0 -94
- coinex_api/ccxt/static_dependencies/marshmallow/decorators.py +0 -231
- coinex_api/ccxt/static_dependencies/marshmallow/error_store.py +0 -60
- coinex_api/ccxt/static_dependencies/marshmallow/exceptions.py +0 -71
- coinex_api/ccxt/static_dependencies/marshmallow/fields.py +0 -2114
- coinex_api/ccxt/static_dependencies/marshmallow/orderedset.py +0 -89
- coinex_api/ccxt/static_dependencies/marshmallow/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/marshmallow/schema.py +0 -1228
- coinex_api/ccxt/static_dependencies/marshmallow/types.py +0 -12
- coinex_api/ccxt/static_dependencies/marshmallow/utils.py +0 -378
- coinex_api/ccxt/static_dependencies/marshmallow/validate.py +0 -678
- coinex_api/ccxt/static_dependencies/marshmallow/warnings.py +0 -2
- coinex_api/ccxt/static_dependencies/marshmallow_dataclass/__init__.py +0 -1047
- coinex_api/ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +0 -51
- coinex_api/ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +0 -45
- coinex_api/ccxt/static_dependencies/marshmallow_dataclass/mypy.py +0 -71
- coinex_api/ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/marshmallow_dataclass/typing.py +0 -14
- coinex_api/ccxt/static_dependencies/marshmallow_dataclass/union_field.py +0 -82
- coinex_api/ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +0 -1
- coinex_api/ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +0 -193
- coinex_api/ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
- coinex_api/ccxt/static_dependencies/msgpack/__init__.py +0 -55
- coinex_api/ccxt/static_dependencies/msgpack/_cmsgpack.pyx +0 -11
- coinex_api/ccxt/static_dependencies/msgpack/_packer.pyx +0 -374
- coinex_api/ccxt/static_dependencies/msgpack/_unpacker.pyx +0 -547
- coinex_api/ccxt/static_dependencies/msgpack/buff_converter.h +0 -8
- coinex_api/ccxt/static_dependencies/msgpack/exceptions.py +0 -48
- coinex_api/ccxt/static_dependencies/msgpack/ext.py +0 -168
- coinex_api/ccxt/static_dependencies/msgpack/fallback.py +0 -951
- coinex_api/ccxt/static_dependencies/msgpack/pack.h +0 -89
- coinex_api/ccxt/static_dependencies/msgpack/pack_template.h +0 -820
- coinex_api/ccxt/static_dependencies/msgpack/sysdep.h +0 -194
- coinex_api/ccxt/static_dependencies/msgpack/unpack.h +0 -391
- coinex_api/ccxt/static_dependencies/msgpack/unpack_define.h +0 -95
- coinex_api/ccxt/static_dependencies/msgpack/unpack_template.h +0 -464
- coinex_api/ccxt/static_dependencies/parsimonious/__init__.py +0 -10
- coinex_api/ccxt/static_dependencies/parsimonious/exceptions.py +0 -105
- coinex_api/ccxt/static_dependencies/parsimonious/expressions.py +0 -479
- coinex_api/ccxt/static_dependencies/parsimonious/grammar.py +0 -487
- coinex_api/ccxt/static_dependencies/parsimonious/nodes.py +0 -325
- coinex_api/ccxt/static_dependencies/parsimonious/utils.py +0 -40
- coinex_api/ccxt/static_dependencies/starknet/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/abi/v0/__init__.py +0 -2
- coinex_api/ccxt/static_dependencies/starknet/abi/v0/model.py +0 -44
- coinex_api/ccxt/static_dependencies/starknet/abi/v0/parser.py +0 -216
- coinex_api/ccxt/static_dependencies/starknet/abi/v0/schemas.py +0 -72
- coinex_api/ccxt/static_dependencies/starknet/abi/v0/shape.py +0 -63
- coinex_api/ccxt/static_dependencies/starknet/abi/v1/__init__.py +0 -2
- coinex_api/ccxt/static_dependencies/starknet/abi/v1/core_structures.json +0 -14
- coinex_api/ccxt/static_dependencies/starknet/abi/v1/model.py +0 -39
- coinex_api/ccxt/static_dependencies/starknet/abi/v1/parser.py +0 -220
- coinex_api/ccxt/static_dependencies/starknet/abi/v1/parser_transformer.py +0 -179
- coinex_api/ccxt/static_dependencies/starknet/abi/v1/schemas.py +0 -66
- coinex_api/ccxt/static_dependencies/starknet/abi/v1/shape.py +0 -47
- coinex_api/ccxt/static_dependencies/starknet/abi/v2/__init__.py +0 -2
- coinex_api/ccxt/static_dependencies/starknet/abi/v2/model.py +0 -89
- coinex_api/ccxt/static_dependencies/starknet/abi/v2/parser.py +0 -293
- coinex_api/ccxt/static_dependencies/starknet/abi/v2/parser_transformer.py +0 -192
- coinex_api/ccxt/static_dependencies/starknet/abi/v2/schemas.py +0 -132
- coinex_api/ccxt/static_dependencies/starknet/abi/v2/shape.py +0 -107
- coinex_api/ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/cairo/data_types.py +0 -123
- coinex_api/ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +0 -77
- coinex_api/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +0 -46
- coinex_api/ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +0 -138
- coinex_api/ccxt/static_dependencies/starknet/cairo/felt.py +0 -64
- coinex_api/ccxt/static_dependencies/starknet/cairo/type_parser.py +0 -121
- coinex_api/ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +0 -59
- coinex_api/ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +0 -77
- coinex_api/ccxt/static_dependencies/starknet/ccxt_utils.py +0 -7
- coinex_api/ccxt/static_dependencies/starknet/common.py +0 -15
- coinex_api/ccxt/static_dependencies/starknet/constants.py +0 -39
- coinex_api/ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/hash/address.py +0 -79
- coinex_api/ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +0 -111
- coinex_api/ccxt/static_dependencies/starknet/hash/selector.py +0 -16
- coinex_api/ccxt/static_dependencies/starknet/hash/storage.py +0 -12
- coinex_api/ccxt/static_dependencies/starknet/hash/utils.py +0 -78
- coinex_api/ccxt/static_dependencies/starknet/models/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/models/typed_data.py +0 -45
- coinex_api/ccxt/static_dependencies/starknet/serialization/__init__.py +0 -24
- coinex_api/ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +0 -40
- coinex_api/ccxt/static_dependencies/starknet/serialization/_context.py +0 -142
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +0 -10
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +0 -82
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +0 -43
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +0 -37
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +0 -66
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +0 -71
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +0 -71
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +0 -50
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +0 -58
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +0 -43
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +0 -40
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +0 -72
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +0 -36
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +0 -36
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +0 -76
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +0 -100
- coinex_api/ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +0 -32
- coinex_api/ccxt/static_dependencies/starknet/serialization/errors.py +0 -10
- coinex_api/ccxt/static_dependencies/starknet/serialization/factory.py +0 -229
- coinex_api/ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +0 -110
- coinex_api/ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +0 -59
- coinex_api/ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +0 -86
- coinex_api/ccxt/static_dependencies/starknet/utils/iterable.py +0 -13
- coinex_api/ccxt/static_dependencies/starknet/utils/schema.py +0 -13
- coinex_api/ccxt/static_dependencies/starknet/utils/typed_data.py +0 -182
- coinex_api/ccxt/static_dependencies/starkware/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +0 -50
- coinex_api/ccxt/static_dependencies/starkware/crypto/math_utils.py +0 -78
- coinex_api/ccxt/static_dependencies/starkware/crypto/signature.py +0 -2344
- coinex_api/ccxt/static_dependencies/starkware/crypto/utils.py +0 -63
- coinex_api/ccxt/static_dependencies/sympy/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/sympy/core/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/sympy/core/intfunc.py +0 -35
- coinex_api/ccxt/static_dependencies/sympy/external/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/sympy/external/gmpy.py +0 -345
- coinex_api/ccxt/static_dependencies/sympy/external/importtools.py +0 -187
- coinex_api/ccxt/static_dependencies/sympy/external/ntheory.py +0 -637
- coinex_api/ccxt/static_dependencies/sympy/external/pythonmpq.py +0 -341
- coinex_api/ccxt/static_dependencies/toolz/__init__.py +0 -26
- coinex_api/ccxt/static_dependencies/toolz/_signatures.py +0 -784
- coinex_api/ccxt/static_dependencies/toolz/_version.py +0 -520
- coinex_api/ccxt/static_dependencies/toolz/compatibility.py +0 -30
- coinex_api/ccxt/static_dependencies/toolz/curried/__init__.py +0 -101
- coinex_api/ccxt/static_dependencies/toolz/curried/exceptions.py +0 -22
- coinex_api/ccxt/static_dependencies/toolz/curried/operator.py +0 -22
- coinex_api/ccxt/static_dependencies/toolz/dicttoolz.py +0 -339
- coinex_api/ccxt/static_dependencies/toolz/functoolz.py +0 -1049
- coinex_api/ccxt/static_dependencies/toolz/itertoolz.py +0 -1057
- coinex_api/ccxt/static_dependencies/toolz/recipes.py +0 -46
- coinex_api/ccxt/static_dependencies/toolz/utils.py +0 -9
- coinex_api/ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
- coinex_api/ccxt/static_dependencies/typing_inspect/typing_inspect.py +0 -851
- coinex_api-0.0.7.dist-info/RECORD +0 -288
- {coinex_api-0.0.7.dist-info → coinex_api-0.0.8.dist-info}/WHEEL +0 -0
@@ -1,194 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* MessagePack system dependencies
|
3
|
-
*
|
4
|
-
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
5
|
-
*
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
* you may not use this file except in compliance with the License.
|
8
|
-
* You may obtain a copy of the License at
|
9
|
-
*
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
*
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
* See the License for the specific language governing permissions and
|
16
|
-
* limitations under the License.
|
17
|
-
*/
|
18
|
-
#ifndef MSGPACK_SYSDEP_H__
|
19
|
-
#define MSGPACK_SYSDEP_H__
|
20
|
-
|
21
|
-
#include <stdlib.h>
|
22
|
-
#include <stddef.h>
|
23
|
-
#if defined(_MSC_VER) && _MSC_VER < 1600
|
24
|
-
typedef __int8 int8_t;
|
25
|
-
typedef unsigned __int8 uint8_t;
|
26
|
-
typedef __int16 int16_t;
|
27
|
-
typedef unsigned __int16 uint16_t;
|
28
|
-
typedef __int32 int32_t;
|
29
|
-
typedef unsigned __int32 uint32_t;
|
30
|
-
typedef __int64 int64_t;
|
31
|
-
typedef unsigned __int64 uint64_t;
|
32
|
-
#elif defined(_MSC_VER) // && _MSC_VER >= 1600
|
33
|
-
#include <stdint.h>
|
34
|
-
#else
|
35
|
-
#include <stdint.h>
|
36
|
-
#include <stdbool.h>
|
37
|
-
#endif
|
38
|
-
|
39
|
-
#ifdef _WIN32
|
40
|
-
#define _msgpack_atomic_counter_header <windows.h>
|
41
|
-
typedef long _msgpack_atomic_counter_t;
|
42
|
-
#define _msgpack_sync_decr_and_fetch(ptr) InterlockedDecrement(ptr)
|
43
|
-
#define _msgpack_sync_incr_and_fetch(ptr) InterlockedIncrement(ptr)
|
44
|
-
#elif defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
|
45
|
-
#define _msgpack_atomic_counter_header "gcc_atomic.h"
|
46
|
-
#else
|
47
|
-
typedef unsigned int _msgpack_atomic_counter_t;
|
48
|
-
#define _msgpack_sync_decr_and_fetch(ptr) __sync_sub_and_fetch(ptr, 1)
|
49
|
-
#define _msgpack_sync_incr_and_fetch(ptr) __sync_add_and_fetch(ptr, 1)
|
50
|
-
#endif
|
51
|
-
|
52
|
-
#ifdef _WIN32
|
53
|
-
|
54
|
-
#ifdef __cplusplus
|
55
|
-
/* numeric_limits<T>::min,max */
|
56
|
-
#ifdef max
|
57
|
-
#undef max
|
58
|
-
#endif
|
59
|
-
#ifdef min
|
60
|
-
#undef min
|
61
|
-
#endif
|
62
|
-
#endif
|
63
|
-
|
64
|
-
#else /* _WIN32 */
|
65
|
-
#include <arpa/inet.h> /* ntohs, ntohl */
|
66
|
-
#endif
|
67
|
-
|
68
|
-
#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
|
69
|
-
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
70
|
-
#define __LITTLE_ENDIAN__
|
71
|
-
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
72
|
-
#define __BIG_ENDIAN__
|
73
|
-
#elif _WIN32
|
74
|
-
#define __LITTLE_ENDIAN__
|
75
|
-
#endif
|
76
|
-
#endif
|
77
|
-
|
78
|
-
|
79
|
-
#ifdef __LITTLE_ENDIAN__
|
80
|
-
|
81
|
-
#ifdef _WIN32
|
82
|
-
# if defined(ntohs)
|
83
|
-
# define _msgpack_be16(x) ntohs(x)
|
84
|
-
# elif defined(_byteswap_ushort) || (defined(_MSC_VER) && _MSC_VER >= 1400)
|
85
|
-
# define _msgpack_be16(x) ((uint16_t)_byteswap_ushort((unsigned short)x))
|
86
|
-
# else
|
87
|
-
# define _msgpack_be16(x) ( \
|
88
|
-
((((uint16_t)x) << 8) ) | \
|
89
|
-
((((uint16_t)x) >> 8) ) )
|
90
|
-
# endif
|
91
|
-
#else
|
92
|
-
# define _msgpack_be16(x) ntohs(x)
|
93
|
-
#endif
|
94
|
-
|
95
|
-
#ifdef _WIN32
|
96
|
-
# if defined(ntohl)
|
97
|
-
# define _msgpack_be32(x) ntohl(x)
|
98
|
-
# elif defined(_byteswap_ulong) || defined(_MSC_VER)
|
99
|
-
# define _msgpack_be32(x) ((uint32_t)_byteswap_ulong((unsigned long)x))
|
100
|
-
# else
|
101
|
-
# define _msgpack_be32(x) \
|
102
|
-
( ((((uint32_t)x) << 24) ) | \
|
103
|
-
((((uint32_t)x) << 8) & 0x00ff0000U ) | \
|
104
|
-
((((uint32_t)x) >> 8) & 0x0000ff00U ) | \
|
105
|
-
((((uint32_t)x) >> 24) ) )
|
106
|
-
# endif
|
107
|
-
#else
|
108
|
-
# define _msgpack_be32(x) ntohl(x)
|
109
|
-
#endif
|
110
|
-
|
111
|
-
#if defined(_byteswap_uint64) || defined(_MSC_VER)
|
112
|
-
# define _msgpack_be64(x) (_byteswap_uint64(x))
|
113
|
-
#elif defined(bswap_64)
|
114
|
-
# define _msgpack_be64(x) bswap_64(x)
|
115
|
-
#elif defined(__DARWIN_OSSwapInt64)
|
116
|
-
# define _msgpack_be64(x) __DARWIN_OSSwapInt64(x)
|
117
|
-
#else
|
118
|
-
#define _msgpack_be64(x) \
|
119
|
-
( ((((uint64_t)x) << 56) ) | \
|
120
|
-
((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \
|
121
|
-
((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \
|
122
|
-
((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \
|
123
|
-
((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \
|
124
|
-
((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \
|
125
|
-
((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \
|
126
|
-
((((uint64_t)x) >> 56) ) )
|
127
|
-
#endif
|
128
|
-
|
129
|
-
#define _msgpack_load16(cast, from) ((cast)( \
|
130
|
-
(((uint16_t)((uint8_t*)(from))[0]) << 8) | \
|
131
|
-
(((uint16_t)((uint8_t*)(from))[1]) ) ))
|
132
|
-
|
133
|
-
#define _msgpack_load32(cast, from) ((cast)( \
|
134
|
-
(((uint32_t)((uint8_t*)(from))[0]) << 24) | \
|
135
|
-
(((uint32_t)((uint8_t*)(from))[1]) << 16) | \
|
136
|
-
(((uint32_t)((uint8_t*)(from))[2]) << 8) | \
|
137
|
-
(((uint32_t)((uint8_t*)(from))[3]) ) ))
|
138
|
-
|
139
|
-
#define _msgpack_load64(cast, from) ((cast)( \
|
140
|
-
(((uint64_t)((uint8_t*)(from))[0]) << 56) | \
|
141
|
-
(((uint64_t)((uint8_t*)(from))[1]) << 48) | \
|
142
|
-
(((uint64_t)((uint8_t*)(from))[2]) << 40) | \
|
143
|
-
(((uint64_t)((uint8_t*)(from))[3]) << 32) | \
|
144
|
-
(((uint64_t)((uint8_t*)(from))[4]) << 24) | \
|
145
|
-
(((uint64_t)((uint8_t*)(from))[5]) << 16) | \
|
146
|
-
(((uint64_t)((uint8_t*)(from))[6]) << 8) | \
|
147
|
-
(((uint64_t)((uint8_t*)(from))[7]) ) ))
|
148
|
-
|
149
|
-
#else
|
150
|
-
|
151
|
-
#define _msgpack_be16(x) (x)
|
152
|
-
#define _msgpack_be32(x) (x)
|
153
|
-
#define _msgpack_be64(x) (x)
|
154
|
-
|
155
|
-
#define _msgpack_load16(cast, from) ((cast)( \
|
156
|
-
(((uint16_t)((uint8_t*)from)[0]) << 8) | \
|
157
|
-
(((uint16_t)((uint8_t*)from)[1]) ) ))
|
158
|
-
|
159
|
-
#define _msgpack_load32(cast, from) ((cast)( \
|
160
|
-
(((uint32_t)((uint8_t*)from)[0]) << 24) | \
|
161
|
-
(((uint32_t)((uint8_t*)from)[1]) << 16) | \
|
162
|
-
(((uint32_t)((uint8_t*)from)[2]) << 8) | \
|
163
|
-
(((uint32_t)((uint8_t*)from)[3]) ) ))
|
164
|
-
|
165
|
-
#define _msgpack_load64(cast, from) ((cast)( \
|
166
|
-
(((uint64_t)((uint8_t*)from)[0]) << 56) | \
|
167
|
-
(((uint64_t)((uint8_t*)from)[1]) << 48) | \
|
168
|
-
(((uint64_t)((uint8_t*)from)[2]) << 40) | \
|
169
|
-
(((uint64_t)((uint8_t*)from)[3]) << 32) | \
|
170
|
-
(((uint64_t)((uint8_t*)from)[4]) << 24) | \
|
171
|
-
(((uint64_t)((uint8_t*)from)[5]) << 16) | \
|
172
|
-
(((uint64_t)((uint8_t*)from)[6]) << 8) | \
|
173
|
-
(((uint64_t)((uint8_t*)from)[7]) ) ))
|
174
|
-
#endif
|
175
|
-
|
176
|
-
|
177
|
-
#define _msgpack_store16(to, num) \
|
178
|
-
do { uint16_t val = _msgpack_be16(num); memcpy(to, &val, 2); } while(0)
|
179
|
-
#define _msgpack_store32(to, num) \
|
180
|
-
do { uint32_t val = _msgpack_be32(num); memcpy(to, &val, 4); } while(0)
|
181
|
-
#define _msgpack_store64(to, num) \
|
182
|
-
do { uint64_t val = _msgpack_be64(num); memcpy(to, &val, 8); } while(0)
|
183
|
-
|
184
|
-
/*
|
185
|
-
#define _msgpack_load16(cast, from) \
|
186
|
-
({ cast val; memcpy(&val, (char*)from, 2); _msgpack_be16(val); })
|
187
|
-
#define _msgpack_load32(cast, from) \
|
188
|
-
({ cast val; memcpy(&val, (char*)from, 4); _msgpack_be32(val); })
|
189
|
-
#define _msgpack_load64(cast, from) \
|
190
|
-
({ cast val; memcpy(&val, (char*)from, 8); _msgpack_be64(val); })
|
191
|
-
*/
|
192
|
-
|
193
|
-
|
194
|
-
#endif /* msgpack/sysdep.h */
|
@@ -1,391 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* MessagePack for Python unpacking routine
|
3
|
-
*
|
4
|
-
* Copyright (C) 2009 Naoki INADA
|
5
|
-
*
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
* you may not use this file except in compliance with the License.
|
8
|
-
* You may obtain a copy of the License at
|
9
|
-
*
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
*
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
* See the License for the specific language governing permissions and
|
16
|
-
* limitations under the License.
|
17
|
-
*/
|
18
|
-
|
19
|
-
#define MSGPACK_EMBED_STACK_SIZE (1024)
|
20
|
-
#include "unpack_define.h"
|
21
|
-
|
22
|
-
typedef struct unpack_user {
|
23
|
-
bool use_list;
|
24
|
-
bool raw;
|
25
|
-
bool has_pairs_hook;
|
26
|
-
bool strict_map_key;
|
27
|
-
int timestamp;
|
28
|
-
PyObject *object_hook;
|
29
|
-
PyObject *list_hook;
|
30
|
-
PyObject *ext_hook;
|
31
|
-
PyObject *timestamp_t;
|
32
|
-
PyObject *giga;
|
33
|
-
PyObject *utc;
|
34
|
-
const char *unicode_errors;
|
35
|
-
Py_ssize_t max_str_len, max_bin_len, max_array_len, max_map_len, max_ext_len;
|
36
|
-
} unpack_user;
|
37
|
-
|
38
|
-
typedef PyObject* msgpack_unpack_object;
|
39
|
-
struct unpack_context;
|
40
|
-
typedef struct unpack_context unpack_context;
|
41
|
-
typedef int (*execute_fn)(unpack_context *ctx, const char* data, Py_ssize_t len, Py_ssize_t* off);
|
42
|
-
|
43
|
-
static inline msgpack_unpack_object unpack_callback_root(unpack_user* u)
|
44
|
-
{
|
45
|
-
return NULL;
|
46
|
-
}
|
47
|
-
|
48
|
-
static inline int unpack_callback_uint16(unpack_user* u, uint16_t d, msgpack_unpack_object* o)
|
49
|
-
{
|
50
|
-
PyObject *p = PyInt_FromLong((long)d);
|
51
|
-
if (!p)
|
52
|
-
return -1;
|
53
|
-
*o = p;
|
54
|
-
return 0;
|
55
|
-
}
|
56
|
-
static inline int unpack_callback_uint8(unpack_user* u, uint8_t d, msgpack_unpack_object* o)
|
57
|
-
{
|
58
|
-
return unpack_callback_uint16(u, d, o);
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
static inline int unpack_callback_uint32(unpack_user* u, uint32_t d, msgpack_unpack_object* o)
|
63
|
-
{
|
64
|
-
PyObject *p = PyInt_FromSize_t((size_t)d);
|
65
|
-
if (!p)
|
66
|
-
return -1;
|
67
|
-
*o = p;
|
68
|
-
return 0;
|
69
|
-
}
|
70
|
-
|
71
|
-
static inline int unpack_callback_uint64(unpack_user* u, uint64_t d, msgpack_unpack_object* o)
|
72
|
-
{
|
73
|
-
PyObject *p;
|
74
|
-
if (d > LONG_MAX) {
|
75
|
-
p = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)d);
|
76
|
-
} else {
|
77
|
-
p = PyInt_FromLong((long)d);
|
78
|
-
}
|
79
|
-
if (!p)
|
80
|
-
return -1;
|
81
|
-
*o = p;
|
82
|
-
return 0;
|
83
|
-
}
|
84
|
-
|
85
|
-
static inline int unpack_callback_int32(unpack_user* u, int32_t d, msgpack_unpack_object* o)
|
86
|
-
{
|
87
|
-
PyObject *p = PyInt_FromLong(d);
|
88
|
-
if (!p)
|
89
|
-
return -1;
|
90
|
-
*o = p;
|
91
|
-
return 0;
|
92
|
-
}
|
93
|
-
|
94
|
-
static inline int unpack_callback_int16(unpack_user* u, int16_t d, msgpack_unpack_object* o)
|
95
|
-
{
|
96
|
-
return unpack_callback_int32(u, d, o);
|
97
|
-
}
|
98
|
-
|
99
|
-
static inline int unpack_callback_int8(unpack_user* u, int8_t d, msgpack_unpack_object* o)
|
100
|
-
{
|
101
|
-
return unpack_callback_int32(u, d, o);
|
102
|
-
}
|
103
|
-
|
104
|
-
static inline int unpack_callback_int64(unpack_user* u, int64_t d, msgpack_unpack_object* o)
|
105
|
-
{
|
106
|
-
PyObject *p;
|
107
|
-
if (d > LONG_MAX || d < LONG_MIN) {
|
108
|
-
p = PyLong_FromLongLong((PY_LONG_LONG)d);
|
109
|
-
} else {
|
110
|
-
p = PyInt_FromLong((long)d);
|
111
|
-
}
|
112
|
-
*o = p;
|
113
|
-
return 0;
|
114
|
-
}
|
115
|
-
|
116
|
-
static inline int unpack_callback_double(unpack_user* u, double d, msgpack_unpack_object* o)
|
117
|
-
{
|
118
|
-
PyObject *p = PyFloat_FromDouble(d);
|
119
|
-
if (!p)
|
120
|
-
return -1;
|
121
|
-
*o = p;
|
122
|
-
return 0;
|
123
|
-
}
|
124
|
-
|
125
|
-
static inline int unpack_callback_float(unpack_user* u, float d, msgpack_unpack_object* o)
|
126
|
-
{
|
127
|
-
return unpack_callback_double(u, d, o);
|
128
|
-
}
|
129
|
-
|
130
|
-
static inline int unpack_callback_nil(unpack_user* u, msgpack_unpack_object* o)
|
131
|
-
{ Py_INCREF(Py_None); *o = Py_None; return 0; }
|
132
|
-
|
133
|
-
static inline int unpack_callback_true(unpack_user* u, msgpack_unpack_object* o)
|
134
|
-
{ Py_INCREF(Py_True); *o = Py_True; return 0; }
|
135
|
-
|
136
|
-
static inline int unpack_callback_false(unpack_user* u, msgpack_unpack_object* o)
|
137
|
-
{ Py_INCREF(Py_False); *o = Py_False; return 0; }
|
138
|
-
|
139
|
-
static inline int unpack_callback_array(unpack_user* u, unsigned int n, msgpack_unpack_object* o)
|
140
|
-
{
|
141
|
-
if (n > u->max_array_len) {
|
142
|
-
PyErr_Format(PyExc_ValueError, "%u exceeds max_array_len(%zd)", n, u->max_array_len);
|
143
|
-
return -1;
|
144
|
-
}
|
145
|
-
PyObject *p = u->use_list ? PyList_New(n) : PyTuple_New(n);
|
146
|
-
|
147
|
-
if (!p)
|
148
|
-
return -1;
|
149
|
-
*o = p;
|
150
|
-
return 0;
|
151
|
-
}
|
152
|
-
|
153
|
-
static inline int unpack_callback_array_item(unpack_user* u, unsigned int current, msgpack_unpack_object* c, msgpack_unpack_object o)
|
154
|
-
{
|
155
|
-
if (u->use_list)
|
156
|
-
PyList_SET_ITEM(*c, current, o);
|
157
|
-
else
|
158
|
-
PyTuple_SET_ITEM(*c, current, o);
|
159
|
-
return 0;
|
160
|
-
}
|
161
|
-
|
162
|
-
static inline int unpack_callback_array_end(unpack_user* u, msgpack_unpack_object* c)
|
163
|
-
{
|
164
|
-
if (u->list_hook) {
|
165
|
-
PyObject *new_c = PyObject_CallFunctionObjArgs(u->list_hook, *c, NULL);
|
166
|
-
if (!new_c)
|
167
|
-
return -1;
|
168
|
-
Py_DECREF(*c);
|
169
|
-
*c = new_c;
|
170
|
-
}
|
171
|
-
return 0;
|
172
|
-
}
|
173
|
-
|
174
|
-
static inline int unpack_callback_map(unpack_user* u, unsigned int n, msgpack_unpack_object* o)
|
175
|
-
{
|
176
|
-
if (n > u->max_map_len) {
|
177
|
-
PyErr_Format(PyExc_ValueError, "%u exceeds max_map_len(%zd)", n, u->max_map_len);
|
178
|
-
return -1;
|
179
|
-
}
|
180
|
-
PyObject *p;
|
181
|
-
if (u->has_pairs_hook) {
|
182
|
-
p = PyList_New(n); // Or use tuple?
|
183
|
-
}
|
184
|
-
else {
|
185
|
-
p = PyDict_New();
|
186
|
-
}
|
187
|
-
if (!p)
|
188
|
-
return -1;
|
189
|
-
*o = p;
|
190
|
-
return 0;
|
191
|
-
}
|
192
|
-
|
193
|
-
static inline int unpack_callback_map_item(unpack_user* u, unsigned int current, msgpack_unpack_object* c, msgpack_unpack_object k, msgpack_unpack_object v)
|
194
|
-
{
|
195
|
-
if (u->strict_map_key && !PyUnicode_CheckExact(k) && !PyBytes_CheckExact(k)) {
|
196
|
-
PyErr_Format(PyExc_ValueError, "%.100s is not allowed for map key when strict_map_key=True", Py_TYPE(k)->tp_name);
|
197
|
-
return -1;
|
198
|
-
}
|
199
|
-
if (PyUnicode_CheckExact(k)) {
|
200
|
-
PyUnicode_InternInPlace(&k);
|
201
|
-
}
|
202
|
-
if (u->has_pairs_hook) {
|
203
|
-
msgpack_unpack_object item = PyTuple_Pack(2, k, v);
|
204
|
-
if (!item)
|
205
|
-
return -1;
|
206
|
-
Py_DECREF(k);
|
207
|
-
Py_DECREF(v);
|
208
|
-
PyList_SET_ITEM(*c, current, item);
|
209
|
-
return 0;
|
210
|
-
}
|
211
|
-
else if (PyDict_SetItem(*c, k, v) == 0) {
|
212
|
-
Py_DECREF(k);
|
213
|
-
Py_DECREF(v);
|
214
|
-
return 0;
|
215
|
-
}
|
216
|
-
return -1;
|
217
|
-
}
|
218
|
-
|
219
|
-
static inline int unpack_callback_map_end(unpack_user* u, msgpack_unpack_object* c)
|
220
|
-
{
|
221
|
-
if (u->object_hook) {
|
222
|
-
PyObject *new_c = PyObject_CallFunctionObjArgs(u->object_hook, *c, NULL);
|
223
|
-
if (!new_c)
|
224
|
-
return -1;
|
225
|
-
|
226
|
-
Py_DECREF(*c);
|
227
|
-
*c = new_c;
|
228
|
-
}
|
229
|
-
return 0;
|
230
|
-
}
|
231
|
-
|
232
|
-
static inline int unpack_callback_raw(unpack_user* u, const char* b, const char* p, unsigned int l, msgpack_unpack_object* o)
|
233
|
-
{
|
234
|
-
if (l > u->max_str_len) {
|
235
|
-
PyErr_Format(PyExc_ValueError, "%u exceeds max_str_len(%zd)", l, u->max_str_len);
|
236
|
-
return -1;
|
237
|
-
}
|
238
|
-
|
239
|
-
PyObject *py;
|
240
|
-
|
241
|
-
if (u->raw) {
|
242
|
-
py = PyBytes_FromStringAndSize(p, l);
|
243
|
-
} else {
|
244
|
-
py = PyUnicode_DecodeUTF8(p, l, u->unicode_errors);
|
245
|
-
}
|
246
|
-
if (!py)
|
247
|
-
return -1;
|
248
|
-
*o = py;
|
249
|
-
return 0;
|
250
|
-
}
|
251
|
-
|
252
|
-
static inline int unpack_callback_bin(unpack_user* u, const char* b, const char* p, unsigned int l, msgpack_unpack_object* o)
|
253
|
-
{
|
254
|
-
if (l > u->max_bin_len) {
|
255
|
-
PyErr_Format(PyExc_ValueError, "%u exceeds max_bin_len(%zd)", l, u->max_bin_len);
|
256
|
-
return -1;
|
257
|
-
}
|
258
|
-
|
259
|
-
PyObject *py = PyBytes_FromStringAndSize(p, l);
|
260
|
-
if (!py)
|
261
|
-
return -1;
|
262
|
-
*o = py;
|
263
|
-
return 0;
|
264
|
-
}
|
265
|
-
|
266
|
-
typedef struct msgpack_timestamp {
|
267
|
-
int64_t tv_sec;
|
268
|
-
uint32_t tv_nsec;
|
269
|
-
} msgpack_timestamp;
|
270
|
-
|
271
|
-
/*
|
272
|
-
* Unpack ext buffer to a timestamp. Pulled from msgpack-c timestamp.h.
|
273
|
-
*/
|
274
|
-
static int unpack_timestamp(const char* buf, unsigned int buflen, msgpack_timestamp* ts) {
|
275
|
-
switch (buflen) {
|
276
|
-
case 4:
|
277
|
-
ts->tv_nsec = 0;
|
278
|
-
{
|
279
|
-
uint32_t v = _msgpack_load32(uint32_t, buf);
|
280
|
-
ts->tv_sec = (int64_t)v;
|
281
|
-
}
|
282
|
-
return 0;
|
283
|
-
case 8: {
|
284
|
-
uint64_t value =_msgpack_load64(uint64_t, buf);
|
285
|
-
ts->tv_nsec = (uint32_t)(value >> 34);
|
286
|
-
ts->tv_sec = value & 0x00000003ffffffffLL;
|
287
|
-
return 0;
|
288
|
-
}
|
289
|
-
case 12:
|
290
|
-
ts->tv_nsec = _msgpack_load32(uint32_t, buf);
|
291
|
-
ts->tv_sec = _msgpack_load64(int64_t, buf + 4);
|
292
|
-
return 0;
|
293
|
-
default:
|
294
|
-
return -1;
|
295
|
-
}
|
296
|
-
}
|
297
|
-
|
298
|
-
#include "datetime.h"
|
299
|
-
|
300
|
-
static int unpack_callback_ext(unpack_user* u, const char* base, const char* pos,
|
301
|
-
unsigned int length, msgpack_unpack_object* o)
|
302
|
-
{
|
303
|
-
int8_t typecode = (int8_t)*pos++;
|
304
|
-
if (!u->ext_hook) {
|
305
|
-
PyErr_SetString(PyExc_AssertionError, "u->ext_hook cannot be NULL");
|
306
|
-
return -1;
|
307
|
-
}
|
308
|
-
if (length-1 > u->max_ext_len) {
|
309
|
-
PyErr_Format(PyExc_ValueError, "%u exceeds max_ext_len(%zd)", length, u->max_ext_len);
|
310
|
-
return -1;
|
311
|
-
}
|
312
|
-
|
313
|
-
PyObject *py = NULL;
|
314
|
-
// length also includes the typecode, so the actual data is length-1
|
315
|
-
if (typecode == -1) {
|
316
|
-
msgpack_timestamp ts;
|
317
|
-
if (unpack_timestamp(pos, length-1, &ts) < 0) {
|
318
|
-
return -1;
|
319
|
-
}
|
320
|
-
|
321
|
-
if (u->timestamp == 2) { // int
|
322
|
-
PyObject *a = PyLong_FromLongLong(ts.tv_sec);
|
323
|
-
if (a == NULL) return -1;
|
324
|
-
|
325
|
-
PyObject *c = PyNumber_Multiply(a, u->giga);
|
326
|
-
Py_DECREF(a);
|
327
|
-
if (c == NULL) {
|
328
|
-
return -1;
|
329
|
-
}
|
330
|
-
|
331
|
-
PyObject *b = PyLong_FromUnsignedLong(ts.tv_nsec);
|
332
|
-
if (b == NULL) {
|
333
|
-
Py_DECREF(c);
|
334
|
-
return -1;
|
335
|
-
}
|
336
|
-
|
337
|
-
py = PyNumber_Add(c, b);
|
338
|
-
Py_DECREF(c);
|
339
|
-
Py_DECREF(b);
|
340
|
-
}
|
341
|
-
else if (u->timestamp == 0) { // Timestamp
|
342
|
-
py = PyObject_CallFunction(u->timestamp_t, "(Lk)", ts.tv_sec, ts.tv_nsec);
|
343
|
-
}
|
344
|
-
else if (u->timestamp == 3) { // datetime
|
345
|
-
// Calculate datetime using epoch + delta
|
346
|
-
// due to limitations PyDateTime_FromTimestamp on Windows with negative timestamps
|
347
|
-
PyObject *epoch = PyDateTimeAPI->DateTime_FromDateAndTime(1970, 1, 1, 0, 0, 0, 0, u->utc, PyDateTimeAPI->DateTimeType);
|
348
|
-
if (epoch == NULL) {
|
349
|
-
return -1;
|
350
|
-
}
|
351
|
-
|
352
|
-
PyObject* d = PyDelta_FromDSU(ts.tv_sec/(24*3600), ts.tv_sec%(24*3600), ts.tv_nsec / 1000);
|
353
|
-
if (d == NULL) {
|
354
|
-
Py_DECREF(epoch);
|
355
|
-
return -1;
|
356
|
-
}
|
357
|
-
|
358
|
-
py = PyNumber_Add(epoch, d);
|
359
|
-
|
360
|
-
Py_DECREF(epoch);
|
361
|
-
Py_DECREF(d);
|
362
|
-
}
|
363
|
-
else { // float
|
364
|
-
PyObject *a = PyFloat_FromDouble((double)ts.tv_nsec);
|
365
|
-
if (a == NULL) return -1;
|
366
|
-
|
367
|
-
PyObject *b = PyNumber_TrueDivide(a, u->giga);
|
368
|
-
Py_DECREF(a);
|
369
|
-
if (b == NULL) return -1;
|
370
|
-
|
371
|
-
PyObject *c = PyLong_FromLongLong(ts.tv_sec);
|
372
|
-
if (c == NULL) {
|
373
|
-
Py_DECREF(b);
|
374
|
-
return -1;
|
375
|
-
}
|
376
|
-
|
377
|
-
a = PyNumber_Add(b, c);
|
378
|
-
Py_DECREF(b);
|
379
|
-
Py_DECREF(c);
|
380
|
-
py = a;
|
381
|
-
}
|
382
|
-
} else {
|
383
|
-
py = PyObject_CallFunction(u->ext_hook, "(iy#)", (int)typecode, pos, (Py_ssize_t)length-1);
|
384
|
-
}
|
385
|
-
if (!py)
|
386
|
-
return -1;
|
387
|
-
*o = py;
|
388
|
-
return 0;
|
389
|
-
}
|
390
|
-
|
391
|
-
#include "unpack_template.h"
|
@@ -1,95 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* MessagePack unpacking routine template
|
3
|
-
*
|
4
|
-
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
5
|
-
*
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
-
* you may not use this file except in compliance with the License.
|
8
|
-
* You may obtain a copy of the License at
|
9
|
-
*
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
*
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
* See the License for the specific language governing permissions and
|
16
|
-
* limitations under the License.
|
17
|
-
*/
|
18
|
-
#ifndef MSGPACK_UNPACK_DEFINE_H__
|
19
|
-
#define MSGPACK_UNPACK_DEFINE_H__
|
20
|
-
|
21
|
-
#include "msgpack/sysdep.h"
|
22
|
-
#include <stdlib.h>
|
23
|
-
#include <string.h>
|
24
|
-
#include <assert.h>
|
25
|
-
#include <stdio.h>
|
26
|
-
|
27
|
-
#ifdef __cplusplus
|
28
|
-
extern "C" {
|
29
|
-
#endif
|
30
|
-
|
31
|
-
|
32
|
-
#ifndef MSGPACK_EMBED_STACK_SIZE
|
33
|
-
#define MSGPACK_EMBED_STACK_SIZE 32
|
34
|
-
#endif
|
35
|
-
|
36
|
-
|
37
|
-
// CS is first byte & 0x1f
|
38
|
-
typedef enum {
|
39
|
-
CS_HEADER = 0x00, // nil
|
40
|
-
|
41
|
-
//CS_ = 0x01,
|
42
|
-
//CS_ = 0x02, // false
|
43
|
-
//CS_ = 0x03, // true
|
44
|
-
|
45
|
-
CS_BIN_8 = 0x04,
|
46
|
-
CS_BIN_16 = 0x05,
|
47
|
-
CS_BIN_32 = 0x06,
|
48
|
-
|
49
|
-
CS_EXT_8 = 0x07,
|
50
|
-
CS_EXT_16 = 0x08,
|
51
|
-
CS_EXT_32 = 0x09,
|
52
|
-
|
53
|
-
CS_FLOAT = 0x0a,
|
54
|
-
CS_DOUBLE = 0x0b,
|
55
|
-
CS_UINT_8 = 0x0c,
|
56
|
-
CS_UINT_16 = 0x0d,
|
57
|
-
CS_UINT_32 = 0x0e,
|
58
|
-
CS_UINT_64 = 0x0f,
|
59
|
-
CS_INT_8 = 0x10,
|
60
|
-
CS_INT_16 = 0x11,
|
61
|
-
CS_INT_32 = 0x12,
|
62
|
-
CS_INT_64 = 0x13,
|
63
|
-
|
64
|
-
//CS_FIXEXT1 = 0x14,
|
65
|
-
//CS_FIXEXT2 = 0x15,
|
66
|
-
//CS_FIXEXT4 = 0x16,
|
67
|
-
//CS_FIXEXT8 = 0x17,
|
68
|
-
//CS_FIXEXT16 = 0x18,
|
69
|
-
|
70
|
-
CS_RAW_8 = 0x19,
|
71
|
-
CS_RAW_16 = 0x1a,
|
72
|
-
CS_RAW_32 = 0x1b,
|
73
|
-
CS_ARRAY_16 = 0x1c,
|
74
|
-
CS_ARRAY_32 = 0x1d,
|
75
|
-
CS_MAP_16 = 0x1e,
|
76
|
-
CS_MAP_32 = 0x1f,
|
77
|
-
|
78
|
-
ACS_RAW_VALUE,
|
79
|
-
ACS_BIN_VALUE,
|
80
|
-
ACS_EXT_VALUE,
|
81
|
-
} msgpack_unpack_state;
|
82
|
-
|
83
|
-
|
84
|
-
typedef enum {
|
85
|
-
CT_ARRAY_ITEM,
|
86
|
-
CT_MAP_KEY,
|
87
|
-
CT_MAP_VALUE,
|
88
|
-
} msgpack_container_type;
|
89
|
-
|
90
|
-
|
91
|
-
#ifdef __cplusplus
|
92
|
-
}
|
93
|
-
#endif
|
94
|
-
|
95
|
-
#endif /* msgpack/unpack_define.h */
|