symbol-sdk-python 3.2.2__tar.gz → 3.2.3__tar.gz
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.
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/PKG-INFO +6 -6
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/pyproject.toml +5 -5
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/BaseValue.py +4 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/ByteArray.py +4 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/Network.py +1 -1
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/facade/NemFacade.py +9 -7
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/facade/SymbolFacade.py +20 -10
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/nc/__init__.py +463 -24
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/sc/__init__.py +660 -4
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/README.md +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/AccountDescriptorRepository.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/ArrayHelpers.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/Bip32.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/BlockchainSettings.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/BufferReader.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/BufferWriter.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/Cipher.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/CodeWordsEncoder.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/CryptoTypes.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/DiceMnemonicGenerator.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/NetworkTimestamp.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/NodeDescriptorRepository.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/Ordered.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/PrivateKeyStorage.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/QrSignatureStorage.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/QrStorage.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/RuleBasedTransactionFactory.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/SharedKey.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/TransactionDescriptorProcessor.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/Transforms.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/__init__.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/external/__init__.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/external/ed25519.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/facade/BatchOperations.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/facade/__init__.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/impl/CipherHelpers.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/impl/__init__.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/nem/KeyPair.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/nem/MessageEncoder.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/nem/Network.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/nem/SharedKey.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/nem/TransactionFactory.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/nem/__init__.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/ripemd160.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/IdGenerator.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/KeyPair.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/Merkle.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/MessageEncoder.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/Metadata.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/Network.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/SharedKey.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/TransactionFactory.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/VotingKeysGenerator.py +0 -0
- {symbol_sdk_python-3.2.2 → symbol_sdk_python-3.2.3}/symbolchain/symbol/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: symbol-sdk-python
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.3
|
|
4
4
|
Summary: Symbol SDK
|
|
5
5
|
Home-page: https://github.com/symbol/symbol/tree/main/sdk/python
|
|
6
6
|
License: MIT
|
|
@@ -9,19 +9,19 @@ Author: Symbol Contributors
|
|
|
9
9
|
Author-email: contributors@symbol.dev
|
|
10
10
|
Maintainer: Symbol Contributors
|
|
11
11
|
Maintainer-email: contributors@symbol.dev
|
|
12
|
-
Requires-Python: >=3.9,<4.0
|
|
12
|
+
Requires-Python: >=3.9.2,<4.0.0
|
|
13
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Requires-Dist: cryptography (>=44.0.0,<44.1.0)
|
|
19
19
|
Requires-Dist: mnemonic (>=0.20,<1.0)
|
|
20
|
-
Requires-Dist: pillow (>=
|
|
20
|
+
Requires-Dist: pillow (>=11.0.0,<11.1.0)
|
|
21
21
|
Requires-Dist: pynacl (>=1.5.0,<1.6.0)
|
|
22
22
|
Requires-Dist: pyyaml (>=6.0.1,<6.1.0)
|
|
23
23
|
Requires-Dist: pyzbar (>=0.1.9,<0.2.0)
|
|
24
|
-
Requires-Dist: qrcode (>=
|
|
24
|
+
Requires-Dist: qrcode (>=8.0,<9.0)
|
|
25
25
|
Requires-Dist: ripemd-hash (>=1.0.1,<1.1.0)
|
|
26
26
|
Requires-Dist: safe-pysha3 (>=1.0.4,<1.1.0)
|
|
27
27
|
Project-URL: Repository, https://github.com/symbol/symbol/tree/main/sdk/python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = 'symbol-sdk-python'
|
|
3
|
-
version = '3.2.
|
|
3
|
+
version = '3.2.3'
|
|
4
4
|
description = 'Symbol SDK'
|
|
5
5
|
authors = ['Symbol Contributors <contributors@symbol.dev>']
|
|
6
6
|
maintainers = ['Symbol Contributors <contributors@symbol.dev>']
|
|
@@ -17,13 +17,13 @@ keywords = ['symbol', 'sdk', 'Symbol SDK']
|
|
|
17
17
|
classifiers = ['Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11']
|
|
18
18
|
|
|
19
19
|
[tool.poetry.dependencies]
|
|
20
|
-
python = "^3.9"
|
|
21
|
-
cryptography = ">=
|
|
20
|
+
python = "^3.9.2"
|
|
21
|
+
cryptography = ">=44.0.0,<44.1.0"
|
|
22
22
|
mnemonic = ">=0.20,<1.0"
|
|
23
|
-
pillow = ">=
|
|
23
|
+
pillow = ">=11.0.0,<11.1.0"
|
|
24
24
|
pynacl = ">=1.5.0,<1.6.0"
|
|
25
25
|
pyyaml = ">=6.0.1,<6.1.0"
|
|
26
26
|
pyzbar = ">=0.1.9,<0.2.0"
|
|
27
|
-
qrcode = ">=
|
|
27
|
+
qrcode = ">=8.0,<9.0"
|
|
28
28
|
ripemd-hash = ">=1.0.1,<1.1.0"
|
|
29
29
|
safe-pysha3 = ">=1.0.4,<1.1.0"
|
|
@@ -49,3 +49,7 @@ class BaseValue(Ordered):
|
|
|
49
49
|
unsigned_value = self.value + upper_bound_plus_one
|
|
50
50
|
|
|
51
51
|
return f'0x{unsigned_value:0{self.size * 2}X}'
|
|
52
|
+
|
|
53
|
+
def to_json(self):
|
|
54
|
+
"""Returns representation of this object that can be stored in JSON."""
|
|
55
|
+
return str(self.value) if 8 <= self.size else self.value
|
|
@@ -9,7 +9,7 @@ class Network:
|
|
|
9
9
|
"""Represents a network."""
|
|
10
10
|
|
|
11
11
|
def __init__(self, name, identifier, datetime_converter, address_class, network_timestamp_class):
|
|
12
|
-
# pylint: disable=too-many-arguments
|
|
12
|
+
# pylint: disable=too-many-arguments,too-many-positional-arguments
|
|
13
13
|
|
|
14
14
|
"""Creates a new network with the specified properties."""
|
|
15
15
|
self.name = name
|
|
@@ -93,16 +93,18 @@ class NemFacade:
|
|
|
93
93
|
return Hash256(sha3.keccak_256(non_verifiable_transaction.serialize()).digest())
|
|
94
94
|
|
|
95
95
|
@staticmethod
|
|
96
|
-
def
|
|
97
|
-
"""
|
|
96
|
+
def extract_signing_payload(transaction):
|
|
97
|
+
"""Gets the payload to sign given a NEM transaction."""
|
|
98
98
|
non_verifiable_transaction = TransactionFactory.to_non_verifiable_transaction(transaction)
|
|
99
|
-
return
|
|
99
|
+
return non_verifiable_transaction.serialize()
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
def sign_transaction(self, key_pair, transaction):
|
|
102
|
+
"""Signs a NEM transaction."""
|
|
103
|
+
return key_pair.sign(self.extract_signing_payload(transaction))
|
|
104
|
+
|
|
105
|
+
def verify_transaction(self, transaction, signature):
|
|
103
106
|
"""Verifies a NEM transaction."""
|
|
104
|
-
|
|
105
|
-
return Verifier(transaction.signer_public_key).verify(non_verifiable_transaction.serialize(), signature)
|
|
107
|
+
return Verifier(transaction.signer_public_key).verify(self.extract_signing_payload(transaction), signature)
|
|
106
108
|
|
|
107
109
|
def bip32_path(self, account_id):
|
|
108
110
|
"""Creates a network compatible BIP32 path for the specified account."""
|
|
@@ -59,6 +59,10 @@ class SymbolAccount(SymbolPublicAccount):
|
|
|
59
59
|
"""Cosigns a Symbol transaction."""
|
|
60
60
|
return self._facade.cosign_transaction(self.key_pair, transaction, detached)
|
|
61
61
|
|
|
62
|
+
def cosign_transaction_hash(self, transaction_hash, detached=False):
|
|
63
|
+
"""Cosigns a Symbol transaction hash."""
|
|
64
|
+
return self._facade.cosign_transaction_hash(self.key_pair, transaction_hash, detached)
|
|
65
|
+
|
|
62
66
|
# endregion
|
|
63
67
|
|
|
64
68
|
|
|
@@ -116,22 +120,23 @@ class SymbolFacade:
|
|
|
116
120
|
hasher.update(self._transaction_data_buffer(transaction.serialize()))
|
|
117
121
|
return Hash256(hasher.digest())
|
|
118
122
|
|
|
119
|
-
def
|
|
120
|
-
"""
|
|
123
|
+
def extract_signing_payload(self, transaction):
|
|
124
|
+
"""Gets the payload to sign given a Symbol transaction."""
|
|
121
125
|
sign_buffer = self.network.generation_hash_seed.bytes
|
|
122
126
|
sign_buffer += self._transaction_data_buffer(transaction.serialize())
|
|
123
|
-
return
|
|
127
|
+
return sign_buffer
|
|
128
|
+
|
|
129
|
+
def sign_transaction(self, key_pair, transaction):
|
|
130
|
+
"""Signs a Symbol transaction."""
|
|
131
|
+
return key_pair.sign(self.extract_signing_payload(transaction))
|
|
124
132
|
|
|
125
133
|
def verify_transaction(self, transaction, signature):
|
|
126
134
|
"""Verifies a Symbol transaction."""
|
|
127
|
-
|
|
128
|
-
verify_buffer += self._transaction_data_buffer(transaction.serialize())
|
|
129
|
-
return Verifier(transaction.signer_public_key).verify(verify_buffer, signature)
|
|
130
|
-
|
|
131
|
-
def cosign_transaction(self, key_pair, transaction, detached=False):
|
|
132
|
-
"""Cosigns a Symbol transaction."""
|
|
133
|
-
transaction_hash = self.hash_transaction(transaction)
|
|
135
|
+
return Verifier(transaction.signer_public_key).verify(self.extract_signing_payload(transaction), signature)
|
|
134
136
|
|
|
137
|
+
@staticmethod
|
|
138
|
+
def cosign_transaction_hash(key_pair, transaction_hash, detached=False):
|
|
139
|
+
"""Cosigns a Symbol transaction hash."""
|
|
135
140
|
cosignature = sc.DetachedCosignature() if detached else sc.Cosignature()
|
|
136
141
|
if detached:
|
|
137
142
|
cosignature.parent_hash = sc.Hash256(transaction_hash.bytes)
|
|
@@ -141,6 +146,11 @@ class SymbolFacade:
|
|
|
141
146
|
cosignature.signature = sc.Signature(key_pair.sign(transaction_hash.bytes).bytes)
|
|
142
147
|
return cosignature
|
|
143
148
|
|
|
149
|
+
def cosign_transaction(self, key_pair, transaction, detached=False):
|
|
150
|
+
"""Cosigns a Symbol transaction."""
|
|
151
|
+
transaction_hash = self.hash_transaction(transaction)
|
|
152
|
+
return self.cosign_transaction_hash(key_pair, transaction_hash, detached)
|
|
153
|
+
|
|
144
154
|
@staticmethod
|
|
145
155
|
def hash_embedded_transactions(embedded_transactions):
|
|
146
156
|
"""Hashes embedded transactions of an aggregate."""
|