shadowPaySDK 16.7.2025.513__tar.gz → 16.7.2025.514__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 (21) hide show
  1. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/PKG-INFO +1 -1
  2. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/setup.py +1 -1
  3. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/types/SOLcheque.py +70 -3
  4. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK.egg-info/PKG-INFO +1 -1
  5. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/LICENSE +0 -0
  6. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/README.md +0 -0
  7. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/setup.cfg +0 -0
  8. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/__init__.py +0 -0
  9. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/const.py +0 -0
  10. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/interface/__init__.py +0 -0
  11. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/interface/erc20.py +0 -0
  12. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/interface/erc721.py +0 -0
  13. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/interface/sol.py +0 -0
  14. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/types/EVMcheque.py +0 -0
  15. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/types/__init__.py +0 -0
  16. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/utils/__init__.py +0 -0
  17. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK/utils/utils.py +0 -0
  18. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK.egg-info/SOURCES.txt +0 -0
  19. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK.egg-info/dependency_links.txt +0 -0
  20. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK.egg-info/requires.txt +0 -0
  21. {shadowpaysdk-16.7.2025.513 → shadowpaysdk-16.7.2025.514}/shadowPaySDK.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 16.7.2025.513
3
+ Version: 16.7.2025.514
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
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='shadowPaySDK',
5
- version='16.7.2025.513',
5
+ version='16.7.2025.514',
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',
@@ -94,6 +94,29 @@ class SOLCheque:
94
94
  "token_out_bps": token_out_bps,
95
95
  "initialized": initialized,
96
96
  }
97
+ def parse_token_cheque_data(self,pda):
98
+ if isinstance(pda, str):
99
+ pda_pubkey = Pubkey.from_string(pda)
100
+ pda_pubkey = pda
101
+ response = self.provider.get_account_info(pda_pubkey)
102
+ if response.value is None:
103
+ return None
104
+
105
+ raw_data = bytes(response.value.data)
106
+ id = int.from_bytes(raw_data[0:8], "little")
107
+ amount = int.from_bytes(raw_data[8:16], "little")
108
+ mint = Pubkey.from_bytes(raw_data[16:48])
109
+ recipient = Pubkey.from_bytes(raw_data[48:80])
110
+ claimed = raw_data[80] != 0
111
+
112
+ return {
113
+ "id": id,
114
+ "amount": amount,
115
+ "mint": str(mint),
116
+ "recipient": str(recipient),
117
+ "claimed": claimed,
118
+ }
119
+
97
120
  def set_params(self, rpc_url = None, key = None):
98
121
  if rpc_url:
99
122
  self.rpc_url = rpc_url
@@ -202,7 +225,7 @@ class SOLCheque:
202
225
  "pda_account": pda_acc,
203
226
  }
204
227
 
205
- # init_token_cheque need fix...
228
+ # init_token_cheque work succesfuly
206
229
 
207
230
  def init_token_cheque(
208
231
  self,
@@ -299,5 +322,49 @@ class SOLCheque:
299
322
  }
300
323
 
301
324
 
302
- def claim_token_cheque(self, pda_acc: str):
303
- pass
325
+ def claim_token_cheque(self, pda_acc: str):
326
+ payer = self.key
327
+ payer_pubkey = payer.pubkey()
328
+ pada_acc = solders.keypair.Keypair.from_base58_string(pda_acc)
329
+ pda_pubkey = pada_acc.pubkey()
330
+ cheque_data = self.parse_token_cheque_data(pda=solders.keypair.Keypair.from_base58_string(pda_acc).pubkey())
331
+
332
+ cheque_token_account = get_associated_token_address(pda_pubkey, Pubkey.from_string(cheque_data["mint"]))
333
+ recipient_token_account = get_associated_token_address(
334
+ Pubkey.from_string(cheque_data["recipient"]), Pubkey.from_string(cheque_data["mint"])
335
+ )
336
+ cfg = self.get_config()
337
+ tressary = cfg["treasury"]
338
+ data = bytes([3])
339
+ ix_program = Instruction(
340
+ program_id=PROGRAM_ID,
341
+ data=bytes([3]),
342
+ accounts=[
343
+ AccountMeta(pubkey=payer_pubkey, is_signer=True, is_writable=True), # 0 claimer
344
+ AccountMeta(pubkey=pda_pubkey, is_signer=False, is_writable=True), # 1 cheque_pda
345
+ AccountMeta(pubkey=cheque_token_account, is_signer=False, is_writable=True), # 2 cheque_token_account
346
+ AccountMeta(pubkey=recipient_token_account, is_signer=False, is_writable=True), # 3 recipient_token_account
347
+ AccountMeta(pubkey=TOKEN_PROGRAM_ID, is_signer=False, is_writable=False), # 4 token_program
348
+ AccountMeta(pubkey=CONFIG_PDA[0], is_signer=False, is_writable=False), # 5 config_account
349
+ AccountMeta(pubkey=Pubkey.from_string(tressary), is_signer=False, is_writable=True), # 6 treasury_account
350
+ ]
351
+ )
352
+
353
+
354
+
355
+
356
+
357
+ blockhash = self.provider.get_latest_blockhash().value.blockhash
358
+
359
+ tx = Transaction(
360
+ message=Message(instructions=[ix_program], payer=payer_pubkey),
361
+ recent_blockhash=blockhash,
362
+ from_keypairs=[payer]
363
+ )
364
+
365
+ sig = self.provider.send_transaction(tx, opts=TxOpts(skip_preflight=True)).value
366
+
367
+ return {
368
+ "pda_pubkey": str(pda_pubkey),
369
+ "signature": str(sig)
370
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 16.7.2025.513
3
+ Version: 16.7.2025.514
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