shadowPaySDK 16.7.2025.6__py3-none-any.whl → 16.7.2025.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.
@@ -45,6 +45,7 @@ class ERC20Token:
45
45
  raw = self.contract.functions.balanceOf(Web3.to_checksum_address(wallet_address)).call()
46
46
  return raw
47
47
 
48
+
48
49
  def allowance(self, owner: str, spender: str) -> float:
49
50
  self._ensure_contract()
50
51
  raw = self.contract.functions.allowance(
@@ -1,6 +1,5 @@
1
1
  import shadowPaySDK
2
2
  from shadowPaySDK.const import __SHADOWPAY_ABI__ERC20__, __ALLOW_CHAINS__, __SHADOWPAY_CONTRACT_ADDRESS__ERC20__
3
- from shadowPaySDK.api import __CREATE__CHEQUE__
4
3
  from web3 import Web3
5
4
  from typing import Optional
6
5
  import httpx
@@ -218,7 +217,7 @@ class Cheque:
218
217
  )
219
218
  estimated_gas = self.contract.functions.InitTokenCheque(
220
219
  Web3.to_checksum_address(token_address),
221
- int(amount * (10 ** decimals)),
220
+ amount,
222
221
  Web3.to_checksum_address(reciver)
223
222
  ).estimate_gas({
224
223
  'from': address,
@@ -226,7 +225,7 @@ class Cheque:
226
225
  })
227
226
  txn = self.contract.functions.InitTokenCheque(
228
227
  Web3.to_checksum_address(token_address),
229
- int(amount * (10 ** decimals)),
228
+ amount,
230
229
  Web3.to_checksum_address(reciver)
231
230
  ).build_transaction({
232
231
  'from': address,
@@ -310,9 +309,9 @@ class Cheque:
310
309
  estimated_gas = self.contract.functions.InitSwapCheque(
311
310
  Web3.to_checksum_address(reciver),
312
311
  Web3.to_checksum_address(token_in),
313
- int(amount_in * (10 ** decimals)),
312
+ amount_in,
314
313
  Web3.to_checksum_address(token_out),
315
- int(amount_out * (10 ** token_out_decinals)),
314
+ amount_out,
316
315
  ).estimate_gas({
317
316
  'from': address,
318
317
  'gasPrice': self.w3.eth.gas_price
@@ -320,9 +319,9 @@ class Cheque:
320
319
  txn = self.contract.functions.InitSwapCheque(
321
320
  Web3.to_checksum_address(reciver),
322
321
  Web3.to_checksum_address(token_in),
323
- int(amount_in * (10 ** decimals)),
322
+ amount_in,
324
323
  Web3.to_checksum_address(token_out),
325
- int(amount_out * (10 ** token_out_decinals))
324
+ amount_out
326
325
  ).build_transaction({
327
326
  'from': address,
328
327
  'nonce': self.w3.eth.get_transaction_count(address),
@@ -371,6 +370,7 @@ class Cheque:
371
370
  )
372
371
  if not approve:
373
372
  return False
373
+ print(f"contract balance: {erc20.get_balance(wallet_address=self.contract.address)}")
374
374
  estimated_gas = self.contract.functions.CashOutSwapCheque(
375
375
  Web3.to_bytes(hexstr=cheque_id)
376
376
  ).estimate_gas({
@@ -410,12 +410,13 @@ class Cheque:
410
410
  async def getTreasery(self):
411
411
  return self.contract.functions.getTreasery().call()
412
412
  async def getSwaoDetail(self, cheque_id: str):
413
- cheque_id_bytes = Web3.to_bytes(hexstr=cheque_id)
414
- s = self.contract.functions.getSwapDetail(cheque_id_bytes).call()
415
- return{
413
+ cheque_id_bytes32 = Web3.to_bytes(hexstr=cheque_id).rjust(32, b'\x00') # паддинг до bytes32
414
+ s = self.contract.functions.getSwapDetail(cheque_id_bytes32).call()
415
+ return {
416
416
  "tokenOut": s[0],
417
417
  "amountOut": s[1],
418
418
  }
419
+
419
420
  class NFTcheque:
420
421
  def __init__(self, w3:Web3, token:str, amount:int, spender:str):
421
422
  self.w3 = w3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 16.7.2025.6
3
+ Version: 16.7.2025.8
4
4
  Summary: ShadowPay SDK for ERC20/ERC721 and P2P smart contract interaction
5
5
  Author: dazay
6
6
  Author-email: shadowpay.protocol@gmail.com
@@ -1,16 +1,16 @@
1
1
  shadowPaySDK/__init__.py,sha256=CMwAuP_6hJN-WueU-XlTNta9Oyd28sFo8OojdgD_pxA,681
2
2
  shadowPaySDK/const.py,sha256=E-w8fivcd-yeHmpOpDAwTIP5FvsArFBHNWbhJ5K01yw,10386
3
3
  shadowPaySDK/interface/__init__.py,sha256=ggSZCV22udnzXm_Wv_3x6VN3hNIAEiwgwHZc2Jwc688,146
4
- shadowPaySDK/interface/erc20.py,sha256=NlnPyR2xrzfDQ4ejd-cMl4bpO97JcCTpT04Yu2Zq1ZI,4476
4
+ shadowPaySDK/interface/erc20.py,sha256=zUTdwhf1hznSGxeEw0HsEFVf1nafHPcxj1X3djPczSo,4477
5
5
  shadowPaySDK/interface/erc721.py,sha256=4AlWfDjrvl85wFocnN93j-oM54kTsLLwv9SdtcLj4eM,3094
6
6
  shadowPaySDK/interface/sol.py,sha256=LsgwE8BzCstsVAxgcbKcYiXAORYMBHcQmNZdzsNkaLQ,7998
7
- shadowPaySDK/types/EVMcheque.py,sha256=BdDeI05BdHhIeyDThRAj6pfLn-Gd_tMTWAZ6h3q-BLU,15841
7
+ shadowPaySDK/types/EVMcheque.py,sha256=_zZR9NmUMiuYVA8setWpPerSgEoUswalhJB-rPWIvTU,15777
8
8
  shadowPaySDK/types/SOLcheque.py,sha256=ZzQgQXBerwa9lelbV8O6JBr1nevCAmJDxrdo8FtKT-4,11795
9
9
  shadowPaySDK/types/__init__.py,sha256=sG6pNZfKGvENXqsnv6MrQtKrJ898fAXkMvAZY1k1-Qg,97
10
10
  shadowPaySDK/utils/__init__.py,sha256=aja3iYO4rT-ptMM-pzw0GRFTziBdXdcEi-4kE84zH64,61
11
11
  shadowPaySDK/utils/utils.py,sha256=g4bGvLDdjhNGsAj1eaZnNWFNaiN-cVhhM-5PrnG5aIQ,720
12
- shadowpaysdk-16.7.2025.6.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
13
- shadowpaysdk-16.7.2025.6.dist-info/METADATA,sha256=BqT8OKm2hWPzoOi8c906o4ibmI-DG1XiDxoo_K7y_qo,1045
14
- shadowpaysdk-16.7.2025.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- shadowpaysdk-16.7.2025.6.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
16
- shadowpaysdk-16.7.2025.6.dist-info/RECORD,,
12
+ shadowpaysdk-16.7.2025.8.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
13
+ shadowpaysdk-16.7.2025.8.dist-info/METADATA,sha256=KzWfWZJCFFBNqN6-aQrQEHpCwRXCRKMDqM5XveVixj8,1045
14
+ shadowpaysdk-16.7.2025.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ shadowpaysdk-16.7.2025.8.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
16
+ shadowpaysdk-16.7.2025.8.dist-info/RECORD,,