shadowPaySDK 0.2.0.12__py3-none-any.whl → 0.2.0.14__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.
@@ -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
@@ -5,13 +5,13 @@ shadowPaySDK/interface/__init__.py,sha256=ggSZCV22udnzXm_Wv_3x6VN3hNIAEiwgwHZc2J
5
5
  shadowPaySDK/interface/erc20.py,sha256=TIsek7ykuYsLMj5no-uastA5gYsIbk-F_Dq-5XPk_6w,4298
6
6
  shadowPaySDK/interface/erc721.py,sha256=4AlWfDjrvl85wFocnN93j-oM54kTsLLwv9SdtcLj4eM,3094
7
7
  shadowPaySDK/interface/sol.py,sha256=flMfmW14J4ybfVshUUTw6iklKa5x-zJzjxRi011XKXA,7230
8
- shadowPaySDK/types/EVMcheque.py,sha256=J9kGr36DNYGzanAoBZUoEYWujoJpj5DX-I1VHULstzI,14055
8
+ shadowPaySDK/types/EVMcheque.py,sha256=mRbMGdOiCmOrdJRSOfr-Nzxx79zJbgZON1_bXPm5Ufk,14204
9
9
  shadowPaySDK/types/SOLcheque.py,sha256=S6LnKxiWDj1KGRgFFAaHy03c7mxv4msaR-2cfVIhD2Y,818
10
10
  shadowPaySDK/types/__init__.py,sha256=sG6pNZfKGvENXqsnv6MrQtKrJ898fAXkMvAZY1k1-Qg,97
11
11
  shadowPaySDK/utils/__init__.py,sha256=aja3iYO4rT-ptMM-pzw0GRFTziBdXdcEi-4kE84zH64,61
12
12
  shadowPaySDK/utils/utils.py,sha256=g4bGvLDdjhNGsAj1eaZnNWFNaiN-cVhhM-5PrnG5aIQ,720
13
- shadowpaysdk-0.2.0.12.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
14
- shadowpaysdk-0.2.0.12.dist-info/METADATA,sha256=s7eJwcUdJyi8stnj2jMAFbU9tnBLNhqXec5_Yf4Z83o,840
15
- shadowpaysdk-0.2.0.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- shadowpaysdk-0.2.0.12.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
17
- shadowpaysdk-0.2.0.12.dist-info/RECORD,,
13
+ shadowpaysdk-0.2.0.14.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
14
+ shadowpaysdk-0.2.0.14.dist-info/METADATA,sha256=m1FKgVr6Msedt4GRI0k4CdhAqClxVPAa7fgtSOI5zj4,840
15
+ shadowpaysdk-0.2.0.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ shadowpaysdk-0.2.0.14.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
17
+ shadowpaysdk-0.2.0.14.dist-info/RECORD,,