shadowPaySDK 16.7.2025.7__py3-none-any.whl → 16.7.2025.9__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.
shadowPaySDK/const.py CHANGED
@@ -32,10 +32,60 @@ __ERC20_ABI__ = json.loads("""[
32
32
 
33
33
  __SHADOWPAY_CONTRACT_ADDRESS__ERC20__ = {
34
34
  97: "0x5487C0DdCbD5465F26B446c6CAB88D8d6F7DF23b",
35
- 10143: "0x35D7950dF4E593dAFaE608Ef34C4fB8b28F21cdC"
35
+ 10143: "0x4C57988fa6641FAE69bBD5Ed679b14004aE88164"
36
36
  }
37
37
 
38
38
  __SHADOWPAY_ABI__ERC20__= json.loads("""[
39
+ {
40
+ "inputs": [
41
+ {
42
+ "internalType": "address",
43
+ "name": "_trassary",
44
+ "type": "address"
45
+ }
46
+ ],
47
+ "stateMutability": "nonpayable",
48
+ "type": "constructor"
49
+ },
50
+ {
51
+ "anonymous": false,
52
+ "inputs": [
53
+ {
54
+ "indexed": false,
55
+ "internalType": "bytes32",
56
+ "name": "id",
57
+ "type": "bytes32"
58
+ }
59
+ ],
60
+ "name": "ChequeClaimed",
61
+ "type": "event"
62
+ },
63
+ {
64
+ "anonymous": false,
65
+ "inputs": [
66
+ {
67
+ "indexed": false,
68
+ "internalType": "bytes32",
69
+ "name": "id",
70
+ "type": "bytes32"
71
+ }
72
+ ],
73
+ "name": "ChequeCreated",
74
+ "type": "event"
75
+ },
76
+ {
77
+ "anonymous": false,
78
+ "inputs": [
79
+ {
80
+ "indexed": true,
81
+ "internalType": "bytes32",
82
+ "name": "id",
83
+ "type": "bytes32"
84
+ }
85
+ ],
86
+ "name": "redeem",
87
+ "type": "event"
88
+ },
39
89
  {
40
90
  "inputs": [
41
91
  {
@@ -76,16 +126,16 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
76
126
  "type": "function"
77
127
  },
78
128
  {
79
- "inputs": [
129
+ "inputs": [],
130
+ "name": "FEE_DENOMINATOR",
131
+ "outputs": [
80
132
  {
81
- "internalType": "address",
82
- "name": "newOwner",
83
- "type": "address"
133
+ "internalType": "uint256",
134
+ "name": "",
135
+ "type": "uint256"
84
136
  }
85
137
  ],
86
- "name": "changeOwner",
87
- "outputs": [],
88
- "stateMutability": "nonpayable",
138
+ "stateMutability": "view",
89
139
  "type": "function"
90
140
  },
91
141
  {
@@ -146,43 +196,6 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
146
196
  "stateMutability": "nonpayable",
147
197
  "type": "function"
148
198
  },
149
- {
150
- "inputs": [
151
- {
152
- "internalType": "address",
153
- "name": "_treaseryAddress",
154
- "type": "address"
155
- }
156
- ],
157
- "name": "setTreasery",
158
- "outputs": [],
159
- "stateMutability": "nonpayable",
160
- "type": "function"
161
- },
162
- {
163
- "inputs": [
164
- {
165
- "internalType": "address",
166
- "name": "_trassary",
167
- "type": "address"
168
- }
169
- ],
170
- "stateMutability": "nonpayable",
171
- "type": "constructor"
172
- },
173
- {
174
- "anonymous": false,
175
- "inputs": [
176
- {
177
- "indexed": false,
178
- "internalType": "bytes32",
179
- "name": "id",
180
- "type": "bytes32"
181
- }
182
- ],
183
- "name": "ChequeCreated",
184
- "type": "event"
185
- },
186
199
  {
187
200
  "inputs": [
188
201
  {
@@ -212,68 +225,15 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
212
225
  "stateMutability": "payable",
213
226
  "type": "function"
214
227
  },
215
- {
216
- "anonymous": false,
217
- "inputs": [
218
- {
219
- "indexed": true,
220
- "internalType": "bytes32",
221
- "name": "id",
222
- "type": "bytes32"
223
- }
224
- ],
225
- "name": "redeem",
226
- "type": "event"
227
- },
228
228
  {
229
229
  "inputs": [
230
- {
231
- "internalType": "uint256",
232
- "name": "_minFee",
233
- "type": "uint256"
234
- },
235
- {
236
- "internalType": "uint256",
237
- "name": "_maxFees",
238
- "type": "uint256"
239
- },
240
- {
241
- "internalType": "uint256",
242
- "name": "_minEth",
243
- "type": "uint256"
244
- },
245
- {
246
- "internalType": "uint256",
247
- "name": "_baseFee",
248
- "type": "uint256"
249
- }
250
- ],
251
- "name": "setFees",
252
- "outputs": [],
253
- "stateMutability": "nonpayable",
254
- "type": "function"
255
- },
256
- {
257
- "inputs": [
258
- {
259
- "internalType": "uint256",
260
- "name": "amount",
261
- "type": "uint256"
262
- },
263
230
  {
264
231
  "internalType": "address",
265
- "name": "_to",
232
+ "name": "newOwner",
266
233
  "type": "address"
267
234
  }
268
235
  ],
269
- "name": "withdrawAmount",
270
- "outputs": [],
271
- "stateMutability": "nonpayable",
272
- "type": "function"
273
- },
274
- {
275
- "inputs": [],
276
- "name": "withdrawFees",
236
+ "name": "changeOwner",
277
237
  "outputs": [],
278
238
  "stateMutability": "nonpayable",
279
239
  "type": "function"
@@ -291,19 +251,6 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
291
251
  "stateMutability": "view",
292
252
  "type": "function"
293
253
  },
294
- {
295
- "inputs": [],
296
- "name": "FEE_DENOMINATOR",
297
- "outputs": [
298
- {
299
- "internalType": "uint256",
300
- "name": "",
301
- "type": "uint256"
302
- }
303
- ],
304
- "stateMutability": "view",
305
- "type": "function"
306
- },
307
254
  {
308
255
  "inputs": [],
309
256
  "name": "feeBasisPoints",
@@ -349,6 +296,11 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
349
296
  "internalType": "address payable[]",
350
297
  "name": "to",
351
298
  "type": "address[]"
299
+ },
300
+ {
301
+ "internalType": "bool",
302
+ "name": "claimed",
303
+ "type": "bool"
352
304
  }
353
305
  ],
354
306
  "stateMutability": "view",
@@ -399,38 +351,63 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
399
351
  "internalType": "uint256",
400
352
  "name": "amountOut",
401
353
  "type": "uint256"
354
+ },
355
+ {
356
+ "internalType": "address",
357
+ "name": "spender",
358
+ "type": "address"
359
+ },
360
+ {
361
+ "internalType": "address",
362
+ "name": "receiver",
363
+ "type": "address"
364
+ },
365
+ {
366
+ "internalType": "bool",
367
+ "name": "claimed",
368
+ "type": "bool"
402
369
  }
403
370
  ],
404
371
  "stateMutability": "view",
405
372
  "type": "function"
406
373
  },
407
374
  {
408
- "inputs": [],
409
- "name": "getTreasery",
375
+ "inputs": [
376
+ {
377
+ "internalType": "bytes32",
378
+ "name": "id",
379
+ "type": "bytes32"
380
+ }
381
+ ],
382
+ "name": "getTokenChequeDetail",
410
383
  "outputs": [
411
384
  {
412
385
  "internalType": "address",
413
- "name": "",
386
+ "name": "spender",
387
+ "type": "address"
388
+ },
389
+ {
390
+ "internalType": "address",
391
+ "name": "receiver",
414
392
  "type": "address"
393
+ },
394
+ {
395
+ "internalType": "bool",
396
+ "name": "claimed",
397
+ "type": "bool"
415
398
  }
416
399
  ],
417
400
  "stateMutability": "view",
418
401
  "type": "function"
419
402
  },
420
403
  {
421
- "inputs": [
422
- {
423
- "internalType": "address",
424
- "name": "_addrr",
425
- "type": "address"
426
- }
427
- ],
428
- "name": "getUserChequeCount",
404
+ "inputs": [],
405
+ "name": "getTreasery",
429
406
  "outputs": [
430
407
  {
431
- "internalType": "uint256",
408
+ "internalType": "address",
432
409
  "name": "",
433
- "type": "uint256"
410
+ "type": "address"
434
411
  }
435
412
  ],
436
413
  "stateMutability": "view",
@@ -481,6 +458,78 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
481
458
  "stateMutability": "view",
482
459
  "type": "function"
483
460
  },
461
+ {
462
+ "inputs": [
463
+ {
464
+ "internalType": "uint256",
465
+ "name": "_minFee",
466
+ "type": "uint256"
467
+ },
468
+ {
469
+ "internalType": "uint256",
470
+ "name": "_maxFees",
471
+ "type": "uint256"
472
+ },
473
+ {
474
+ "internalType": "uint256",
475
+ "name": "_minEth",
476
+ "type": "uint256"
477
+ },
478
+ {
479
+ "internalType": "uint256",
480
+ "name": "_baseFee",
481
+ "type": "uint256"
482
+ }
483
+ ],
484
+ "name": "setFees",
485
+ "outputs": [],
486
+ "stateMutability": "nonpayable",
487
+ "type": "function"
488
+ },
489
+ {
490
+ "inputs": [
491
+ {
492
+ "internalType": "uint256",
493
+ "name": "_TokenChequepercentage",
494
+ "type": "uint256"
495
+ },
496
+ {
497
+ "internalType": "uint256",
498
+ "name": "_SwapTokenChequepercentage",
499
+ "type": "uint256"
500
+ }
501
+ ],
502
+ "name": "setTokenFees",
503
+ "outputs": [],
504
+ "stateMutability": "nonpayable",
505
+ "type": "function"
506
+ },
507
+ {
508
+ "inputs": [
509
+ {
510
+ "internalType": "address",
511
+ "name": "_treaseryAddress",
512
+ "type": "address"
513
+ }
514
+ ],
515
+ "name": "setTreasery",
516
+ "outputs": [],
517
+ "stateMutability": "nonpayable",
518
+ "type": "function"
519
+ },
520
+ {
521
+ "inputs": [],
522
+ "name": "swapBasicPoints",
523
+ "outputs": [
524
+ {
525
+ "internalType": "uint256",
526
+ "name": "",
527
+ "type": "uint256"
528
+ }
529
+ ],
530
+ "stateMutability": "view",
531
+ "type": "function"
532
+ },
484
533
  {
485
534
  "inputs": [
486
535
  {
@@ -542,6 +591,31 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
542
591
  ],
543
592
  "stateMutability": "view",
544
593
  "type": "function"
594
+ },
595
+ {
596
+ "inputs": [
597
+ {
598
+ "internalType": "uint256",
599
+ "name": "amount",
600
+ "type": "uint256"
601
+ },
602
+ {
603
+ "internalType": "address",
604
+ "name": "_to",
605
+ "type": "address"
606
+ }
607
+ ],
608
+ "name": "withdrawAmount",
609
+ "outputs": [],
610
+ "stateMutability": "nonpayable",
611
+ "type": "function"
612
+ },
613
+ {
614
+ "inputs": [],
615
+ "name": "withdrawFees",
616
+ "outputs": [],
617
+ "stateMutability": "nonpayable",
618
+ "type": "function"
545
619
  }
546
620
  ]""")
547
621
 
@@ -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(
@@ -217,7 +217,7 @@ class Cheque:
217
217
  )
218
218
  estimated_gas = self.contract.functions.InitTokenCheque(
219
219
  Web3.to_checksum_address(token_address),
220
- int(amount * (10 ** decimals)),
220
+ amount,
221
221
  Web3.to_checksum_address(reciver)
222
222
  ).estimate_gas({
223
223
  'from': address,
@@ -225,7 +225,7 @@ class Cheque:
225
225
  })
226
226
  txn = self.contract.functions.InitTokenCheque(
227
227
  Web3.to_checksum_address(token_address),
228
- int(amount * (10 ** decimals)),
228
+ amount,
229
229
  Web3.to_checksum_address(reciver)
230
230
  ).build_transaction({
231
231
  'from': address,
@@ -309,9 +309,9 @@ class Cheque:
309
309
  estimated_gas = self.contract.functions.InitSwapCheque(
310
310
  Web3.to_checksum_address(reciver),
311
311
  Web3.to_checksum_address(token_in),
312
- int(amount_in * (10 ** decimals)),
312
+ amount_in,
313
313
  Web3.to_checksum_address(token_out),
314
- int(amount_out * (10 ** token_out_decinals)),
314
+ amount_out,
315
315
  ).estimate_gas({
316
316
  'from': address,
317
317
  'gasPrice': self.w3.eth.gas_price
@@ -319,9 +319,9 @@ class Cheque:
319
319
  txn = self.contract.functions.InitSwapCheque(
320
320
  Web3.to_checksum_address(reciver),
321
321
  Web3.to_checksum_address(token_in),
322
- int(amount_in * (10 ** decimals)),
322
+ amount_in,
323
323
  Web3.to_checksum_address(token_out),
324
- int(amount_out * (10 ** token_out_decinals))
324
+ amount_out
325
325
  ).build_transaction({
326
326
  'from': address,
327
327
  'nonce': self.w3.eth.get_transaction_count(address),
@@ -370,6 +370,7 @@ class Cheque:
370
370
  )
371
371
  if not approve:
372
372
  return False
373
+ print(f"contract balance: {erc20.get_balance(wallet_address=self.contract.address)}")
373
374
  estimated_gas = self.contract.functions.CashOutSwapCheque(
374
375
  Web3.to_bytes(hexstr=cheque_id)
375
376
  ).estimate_gas({
@@ -409,12 +410,13 @@ class Cheque:
409
410
  async def getTreasery(self):
410
411
  return self.contract.functions.getTreasery().call()
411
412
  async def getSwaoDetail(self, cheque_id: str):
412
- cheque_id_bytes = Web3.to_bytes(hexstr=cheque_id)
413
- s = self.contract.functions.getSwapDetail(cheque_id_bytes).call()
414
- 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 {
415
416
  "tokenOut": s[0],
416
417
  "amountOut": s[1],
417
418
  }
419
+
418
420
  class NFTcheque:
419
421
  def __init__(self, w3:Web3, token:str, amount:int, spender:str):
420
422
  self.w3 = w3
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 16.7.2025.7
3
+ Version: 16.7.2025.9
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
- shadowPaySDK/const.py,sha256=E-w8fivcd-yeHmpOpDAwTIP5FvsArFBHNWbhJ5K01yw,10386
2
+ shadowPaySDK/const.py,sha256=fXwkjNfKLcOdgRV0Ewo0lZpqRWRHS6zx_Q_wQmx5zkU,11626
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=lBYTtgDRyM5hBaki0x3TzipDDjJMqLRnAP9m_Av7fsU,15792
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.7.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
13
- shadowpaysdk-16.7.2025.7.dist-info/METADATA,sha256=xmh_Twm5JZSyYphr0gFokcZJUU6PQLqcg9ruGnBFU4U,1045
14
- shadowpaysdk-16.7.2025.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- shadowpaysdk-16.7.2025.7.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
16
- shadowpaysdk-16.7.2025.7.dist-info/RECORD,,
12
+ shadowpaysdk-16.7.2025.9.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
13
+ shadowpaysdk-16.7.2025.9.dist-info/METADATA,sha256=l0VHregxm8CDYKYnLcKH9-rdRPGInrnS_RTySk0QoPM,1045
14
+ shadowpaysdk-16.7.2025.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ shadowpaysdk-16.7.2025.9.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
16
+ shadowpaysdk-16.7.2025.9.dist-info/RECORD,,