symbol-sdk-python 3.3.2__tar.gz → 3.3.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.3.2 → symbol_sdk_python-3.3.3}/PKG-INFO +3 -3
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/pyproject.toml +3 -3
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/RuleBasedTransactionFactory.py +1 -1
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/facade/NemFacade.py +11 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/facade/SymbolFacade.py +27 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/FeeCalculator.py +1 -1
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/README.md +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/AccountDescriptorRepository.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/ArrayHelpers.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/BaseValue.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/Bip32.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/BlockchainSettings.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/BufferReader.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/BufferWriter.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/ByteArray.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/Cipher.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/CodeWordsEncoder.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/CryptoTypes.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/DiceMnemonicGenerator.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/Network.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/NetworkTimestamp.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/NodeDescriptorRepository.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/Ordered.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/PrivateKeyStorage.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/QrSignatureStorage.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/QrStorage.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/SharedKey.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/TransactionDescriptorProcessor.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/Transforms.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/__init__.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/external/__init__.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/external/ed25519.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/facade/BatchOperations.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/facade/__init__.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/impl/CipherHelpers.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/impl/__init__.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nc/__init__.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nem/FeeCalculator.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nem/KeyPair.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nem/MessageEncoder.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nem/Network.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nem/SharedKey.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nem/TransactionFactory.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/nem/__init__.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/ripemd160.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/sc/__init__.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/IdGenerator.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/KeyPair.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/Merkle.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/MessageEncoder.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/Metadata.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/Network.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/Restriction.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/SharedKey.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/TransactionFactory.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/VotingKeysGenerator.py +0 -0
- {symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.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.3.
|
|
3
|
+
Version: 3.3.3
|
|
4
4
|
Summary: Symbol SDK
|
|
5
5
|
Home-page: https://github.com/symbol/symbol/tree/main/sdk/python
|
|
6
6
|
License: MIT
|
|
@@ -17,9 +17,9 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
-
Requires-Dist: cryptography (>=
|
|
20
|
+
Requires-Dist: cryptography (>=50.0.0,<50.1.0)
|
|
21
21
|
Requires-Dist: mnemonic (>=0.20,<1.0)
|
|
22
|
-
Requires-Dist: pillow (>=12.
|
|
22
|
+
Requires-Dist: pillow (>=12.3.0,<12.4.0)
|
|
23
23
|
Requires-Dist: pynacl (>=1.6.0,<1.7.0)
|
|
24
24
|
Requires-Dist: pyyaml (>=6.0.1,<6.1.0)
|
|
25
25
|
Requires-Dist: pyzbar (>=0.1.9,<0.2.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = 'symbol-sdk-python'
|
|
3
|
-
version = '3.3.
|
|
3
|
+
version = '3.3.3'
|
|
4
4
|
description = 'Symbol SDK'
|
|
5
5
|
authors = ['Symbol Contributors <contributors@symbol.dev>']
|
|
6
6
|
maintainers = ['Symbol Contributors <contributors@symbol.dev>']
|
|
@@ -18,9 +18,9 @@ classifiers = ['Programming Language :: Python :: 3.10', 'Programming Language :
|
|
|
18
18
|
|
|
19
19
|
[tool.poetry.dependencies]
|
|
20
20
|
python = "^3.10"
|
|
21
|
-
cryptography = ">=
|
|
21
|
+
cryptography = ">=50.0.0,<50.1.0"
|
|
22
22
|
mnemonic = ">=0.20,<1.0"
|
|
23
|
-
pillow = ">=12.
|
|
23
|
+
pillow = ">=12.3.0,<12.4.0"
|
|
24
24
|
pynacl = ">=1.6.0,<1.7.0"
|
|
25
25
|
pyyaml = ">=6.0.1,<6.1.0"
|
|
26
26
|
pyzbar = ">=0.1.9,<0.2.0"
|
{symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/RuleBasedTransactionFactory.py
RENAMED
|
@@ -165,7 +165,7 @@ class RuleBasedTransactionFactory:
|
|
|
165
165
|
return
|
|
166
166
|
|
|
167
167
|
for key, value in vars(entity).items():
|
|
168
|
-
if '_' == key[0] and '_' == key[-1]: # skip system properties
|
|
168
|
+
if '_' == key[0] and '_' == key[-1] and key[1:-1] not in ('property'): # skip system properties
|
|
169
169
|
continue
|
|
170
170
|
|
|
171
171
|
if isinstance(value, str):
|
|
@@ -86,6 +86,17 @@ class NemFacade:
|
|
|
86
86
|
"""Creates a NEM account from a private key."""
|
|
87
87
|
return NemAccount(self, KeyPair(private_key))
|
|
88
88
|
|
|
89
|
+
def create_transaction_from_descriptor(self, descriptor, signer_public_key, fee, deadline_seconds):
|
|
90
|
+
"""Creates a transaction from a descriptor, adding signer, fee, timestamp and deadline to a copy of it."""
|
|
91
|
+
now = self.now()
|
|
92
|
+
return self.transaction_factory.create({
|
|
93
|
+
**descriptor,
|
|
94
|
+
'signer_public_key': signer_public_key,
|
|
95
|
+
'fee': fee,
|
|
96
|
+
'timestamp': now.timestamp,
|
|
97
|
+
'deadline': now.add_seconds(deadline_seconds).timestamp
|
|
98
|
+
})
|
|
99
|
+
|
|
89
100
|
@staticmethod
|
|
90
101
|
def hash_transaction(transaction):
|
|
91
102
|
"""Hashes a NEM transaction."""
|
|
@@ -115,6 +115,33 @@ class SymbolFacade:
|
|
|
115
115
|
"""Creates a Symbol account from a private key."""
|
|
116
116
|
return SymbolAccount(self, KeyPair(private_key))
|
|
117
117
|
|
|
118
|
+
def create_transaction_from_descriptor(self, descriptor, signer_public_key, fee_multiplier, deadline_seconds, cosignature_count=0):
|
|
119
|
+
"""
|
|
120
|
+
Creates a transaction from a descriptor, adding signer and deadline to a copy of it, with the fee computed as
|
|
121
|
+
(size + reserved cosignatures size) * fee_multiplier.
|
|
122
|
+
"""
|
|
123
|
+
raw_descriptor = {
|
|
124
|
+
**descriptor,
|
|
125
|
+
'signer_public_key': signer_public_key,
|
|
126
|
+
'deadline': self.now().add_seconds(deadline_seconds).timestamp
|
|
127
|
+
}
|
|
128
|
+
transaction = self.transaction_factory.create(raw_descriptor)
|
|
129
|
+
|
|
130
|
+
# if cosignatures are specified in the descriptor, use the max of them and cosignature_count
|
|
131
|
+
cosignature_count_adjustment = cosignature_count
|
|
132
|
+
explicit_cosignatures = raw_descriptor.get('cosignatures')
|
|
133
|
+
if isinstance(explicit_cosignatures, list):
|
|
134
|
+
explicit_count = len(explicit_cosignatures)
|
|
135
|
+
cosignature_count_adjustment = 0 if explicit_count > cosignature_count else cosignature_count - explicit_count
|
|
136
|
+
|
|
137
|
+
transaction_with_cosignatures_size = transaction.size + cosignature_count_adjustment * sc.Cosignature().size
|
|
138
|
+
transaction.fee = sc.Amount(transaction_with_cosignatures_size * fee_multiplier)
|
|
139
|
+
return transaction
|
|
140
|
+
|
|
141
|
+
def create_embedded_transaction_from_descriptor(self, descriptor, signer_public_key): # pylint: disable=invalid-name
|
|
142
|
+
"""Creates an embedded transaction from a descriptor, adding signer to a copy of it."""
|
|
143
|
+
return self.transaction_factory.create_embedded({**descriptor, 'signer_public_key': signer_public_key})
|
|
144
|
+
|
|
118
145
|
def hash_transaction(self, transaction):
|
|
119
146
|
"""Hashes a Symbol transaction."""
|
|
120
147
|
hasher = hashlib.sha3_256()
|
|
@@ -4,4 +4,4 @@ from symbolchain.sc import Cosignature
|
|
|
4
4
|
def calculate_transaction_fee(transaction, fee_multiplier, cosignature_count=0):
|
|
5
5
|
"""Calculates the minimum required transaction fee for a transaction."""
|
|
6
6
|
|
|
7
|
-
return transaction.size
|
|
7
|
+
return (transaction.size + Cosignature().size * cosignature_count) * fee_multiplier
|
|
File without changes
|
{symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/AccountDescriptorRepository.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/TransactionDescriptorProcessor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/TransactionFactory.py
RENAMED
|
File without changes
|
{symbol_sdk_python-3.3.2 → symbol_sdk_python-3.3.3}/symbolchain/symbol/VotingKeysGenerator.py
RENAMED
|
File without changes
|
|
File without changes
|