shadowPaySDK 0.2.0.12__tar.gz → 0.2.0.14__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.
Files changed (22) hide show
  1. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/PKG-INFO +1 -1
  2. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/setup.py +1 -1
  3. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/types/EVMcheque.py +18 -3
  4. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK.egg-info/PKG-INFO +1 -1
  5. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/LICENSE +0 -0
  6. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/README.md +0 -0
  7. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/setup.cfg +0 -0
  8. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/__init__.py +0 -0
  9. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/api.py +0 -0
  10. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/const.py +0 -0
  11. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/interface/__init__.py +0 -0
  12. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/interface/erc20.py +0 -0
  13. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/interface/erc721.py +0 -0
  14. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/interface/sol.py +0 -0
  15. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/types/SOLcheque.py +0 -0
  16. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/types/__init__.py +0 -0
  17. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/utils/__init__.py +0 -0
  18. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK/utils/utils.py +0 -0
  19. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK.egg-info/SOURCES.txt +0 -0
  20. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK.egg-info/dependency_links.txt +0 -0
  21. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK.egg-info/requires.txt +0 -0
  22. {shadowpaysdk-0.2.0.12 → shadowpaysdk-0.2.0.14}/shadowPaySDK.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 0.2.0.12
3
+ Version: 0.2.0.14
4
4
  Summary: ShadowPay SDK for ERC20/ERC721 and P2P smart contract interaction
5
5
  Author: dazarius_
6
6
  Author-email: your@email.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='shadowPaySDK',
5
- version='0.2.0.12',
5
+ version='0.2.0.14',
6
6
  description='ShadowPay SDK for ERC20/ERC721 and P2P smart contract interaction',
7
7
  long_description=open('README.md').read(),
8
8
  long_description_content_type='text/markdown',
@@ -67,18 +67,33 @@ class Cheque:
67
67
  async def InitCheque(self, amount, receiver:list, private_key:Optional[str] = None):
68
68
  if not isinstance(receiver,list):
69
69
  raise ValueError("Receiver must be a list of addresses, [""0x1234...5678", "0x2345...6789""]")
70
+
71
+ key = private_key or self.private_key
72
+
73
+ if key:
74
+ address = Web3.to_checksum_address(self.w3.eth.account.from_key(key).address)
75
+ print("InitCheque", amount, receiver, key)
70
76
 
77
+ elif self.address:
78
+ address = Web3.to_checksum_address(self.address)
79
+ else:
80
+ raise ValueError("No private key or address provided")
81
+
82
+
83
+
84
+
85
+
71
86
  receiver = [Web3.to_checksum_address(addr) for addr in receiver]
72
87
  estimated_gas = self.contract.functions.InitCheque(receiver).estimate_gas({
73
- 'from': self.w3.eth.account.from_key(private_key or self.private_key).address or self.address,
88
+ 'from': address,
74
89
  'value': self.w3.to_wei(amount, 'ether'),
75
90
  'gasPrice': self.w3.eth.gas_price
76
91
  })
77
92
  txn = self.contract.functions.InitCheque(receiver).build_transaction({
78
- 'from': self.w3.eth.account.from_key(private_key or self.private_key).address or self.address,
93
+ 'from': address,
79
94
  'value': self.w3.to_wei(amount, 'ether'),
80
95
  'nonce': self.w3.eth.get_transaction_count(
81
- self.w3.eth.account.from_key(private_key or self.private_key).address or self.address
96
+ address
82
97
  ),
83
98
  'gas': estimated_gas,
84
99
  'gasPrice': self.w3.eth.gas_price,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 0.2.0.12
3
+ Version: 0.2.0.14
4
4
  Summary: ShadowPay SDK for ERC20/ERC721 and P2P smart contract interaction
5
5
  Author: dazarius_
6
6
  Author-email: your@email.com
File without changes