shadowPaySDK 0.2.1__tar.gz → 1.0.0__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 (27) hide show
  1. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/PKG-INFO +21 -8
  2. shadowpaysdk-1.0.0/README.md +21 -0
  3. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/setup.py +7 -7
  4. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/__init__.py +1 -3
  5. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/const.py +221 -128
  6. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/interface/__init__.py +2 -2
  7. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/interface/erc20.py +30 -24
  8. shadowpaysdk-1.0.0/shadowPaySDK/interface/sol.py +224 -0
  9. shadowpaysdk-1.0.0/shadowPaySDK/types/EVMcheque.py +504 -0
  10. shadowpaysdk-1.0.0/shadowPaySDK/types/SOLcheque.py +486 -0
  11. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK.egg-info/PKG-INFO +21 -8
  12. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK.egg-info/SOURCES.txt +0 -1
  13. shadowpaysdk-1.0.0/shadowPaySDK.egg-info/requires.txt +6 -0
  14. shadowpaysdk-0.2.1/README.md +0 -8
  15. shadowpaysdk-0.2.1/shadowPaySDK/api.py +0 -48
  16. shadowpaysdk-0.2.1/shadowPaySDK/interface/sol.py +0 -162
  17. shadowpaysdk-0.2.1/shadowPaySDK/types/EVMcheque.py +0 -325
  18. shadowpaysdk-0.2.1/shadowPaySDK/types/SOLcheque.py +0 -27
  19. shadowpaysdk-0.2.1/shadowPaySDK.egg-info/requires.txt +0 -6
  20. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/LICENSE +0 -0
  21. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/setup.cfg +0 -0
  22. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/interface/erc721.py +0 -0
  23. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/types/__init__.py +0 -0
  24. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/utils/__init__.py +0 -0
  25. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK/utils/utils.py +0 -0
  26. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK.egg-info/dependency_links.txt +0 -0
  27. {shadowpaysdk-0.2.1 → shadowpaysdk-1.0.0}/shadowPaySDK.egg-info/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 0.2.1
3
+ Version: 1.0.0
4
4
  Summary: ShadowPay SDK for ERC20/ERC721 and P2P smart contract interaction
5
- Author: dazarius_
6
- Author-email: your@email.com
5
+ Author: dazay
6
+ Author-email: shadowpay.protocol@gmail.com
7
7
  License: MIT
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
@@ -11,10 +11,10 @@ Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.9
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
- Requires-Dist: web3>=6.0.0
15
- Requires-Dist: requests>=2.28.0
16
- Requires-Dist: solana==0.36.7
17
- Requires-Dist: anchorpy>=0.21.0
14
+ Requires-Dist: web3
15
+ Requires-Dist: requests
16
+ Requires-Dist: solana
17
+ Requires-Dist: anchorpy
18
18
  Requires-Dist: solders
19
19
  Requires-Dist: httpx==0.28.1
20
20
  Dynamic: author
@@ -28,11 +28,24 @@ Dynamic: requires-dist
28
28
  Dynamic: requires-python
29
29
  Dynamic: summary
30
30
 
31
- # shadowPayS
31
+ # shadowPaySdk
32
32
 
33
33
  ```bash
34
34
  pip3 install shadowPaySDK
35
+ pip3 install --break-system-packages git+https://github.com/dazarius/SDK.git
35
36
  ```
37
+ ```example to use cheque
38
+
39
+
40
+
41
+
42
+
43
+ import shadowPaySDK
44
+
45
+
46
+ EVMcheque = shadowPaySDK.Cheque(
47
+ retunrn_build_tx=True
48
+ )
36
49
 
37
50
 
38
51
 
@@ -0,0 +1,21 @@
1
+ # shadowPaySdk
2
+
3
+ ```bash
4
+ pip3 install shadowPaySDK
5
+ pip3 install --break-system-packages git+https://github.com/dazarius/SDK.git
6
+ ```
7
+ ```example to use cheque
8
+
9
+
10
+
11
+
12
+
13
+ import shadowPaySDK
14
+
15
+
16
+ EVMcheque = shadowPaySDK.Cheque(
17
+ retunrn_build_tx=True
18
+ )
19
+
20
+
21
+
@@ -2,12 +2,12 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='shadowPaySDK',
5
- version='0.2.1',
5
+ version='1.0.0',
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',
9
- author='dazarius_',
10
- author_email='your@email.com',
9
+ author='dazay',
10
+ author_email='shadowpay.protocol@gmail.com',
11
11
  license='MIT',
12
12
  packages=find_packages(),
13
13
  classifiers=[
@@ -16,10 +16,10 @@ setup(
16
16
  'Operating System :: OS Independent',
17
17
  ],
18
18
  install_requires=[
19
- 'web3>=6.0.0',
20
- 'requests>=2.28.0',
21
- 'solana==0.36.7',
22
- 'anchorpy>=0.21.0',
19
+ 'web3',
20
+ 'requests',
21
+ 'solana',
22
+ 'anchorpy',
23
23
 
24
24
  'solders',
25
25
  'httpx==0.28.1'
@@ -1,12 +1,10 @@
1
1
  import json
2
2
  from shadowPaySDK.interface.erc20 import ERC20Token
3
3
  from shadowPaySDK.interface.erc721 import ERC721Token
4
- from shadowPaySDK.interface.sol import SolTokens
5
- from shadowPaySDK.interface.sol import SOL
4
+ from shadowPaySDK.interface.sol import SOL as sol
6
5
  from shadowPaySDK.types.EVMcheque import Cheque
7
6
  from shadowPaySDK.types.SOLcheque import SOLCheque
8
7
  from shadowPaySDK.const import __ERC20_ABI__, __SHADOWPAY_ABI__ERC20__,__ALLOW_CHAINS__, __SHADOWPAY_CONTRACT_ADDRESS__ERC20__
9
- from shadowPaySDK.api import __MAIN__URL__, __CREATE__CHEQUE__, get_my_cheques, create_cheque
10
8
 
11
9
 
12
10
  # from shadowPaySDK.utils import parse_tx as PARSE_TX
@@ -1,8 +1,9 @@
1
1
  import json
2
-
2
+ from solders.pubkey import Pubkey
3
3
  __ALLOW_CHAINS__ = [
4
4
  56, # BSC Mainnet
5
5
  97, # BSC Testnet
6
+ 10143,
6
7
  0x1,
7
8
  0x1f984,
8
9
  0x38,
@@ -11,6 +12,9 @@ __ALLOW_CHAINS__ = [
11
12
  0xa
12
13
  ]
13
14
 
15
+
16
+
17
+
14
18
  __VERSION__ = "0.1.2"
15
19
 
16
20
 
@@ -27,10 +31,61 @@ __ERC20_ABI__ = json.loads("""[
27
31
  ]""")
28
32
 
29
33
  __SHADOWPAY_CONTRACT_ADDRESS__ERC20__ = {
30
- 97: "0x17a82E53a3b3f2acA7ceae8CA6B6b3B8F14e4441"
34
+ 97: "0x5487C0DdCbD5465F26B446c6CAB88D8d6F7DF23b",
35
+ 10143: "0x1d856f2eA4738d1a89E27dbfc8950a4976Db41a5"
31
36
  }
32
37
 
33
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
+ },
34
89
  {
35
90
  "inputs": [
36
91
  {
@@ -71,16 +126,16 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
71
126
  "type": "function"
72
127
  },
73
128
  {
74
- "inputs": [
129
+ "inputs": [],
130
+ "name": "FEE_DENOMINATOR",
131
+ "outputs": [
75
132
  {
76
- "internalType": "address",
77
- "name": "newOwner",
78
- "type": "address"
133
+ "internalType": "uint256",
134
+ "name": "",
135
+ "type": "uint256"
79
136
  }
80
137
  ],
81
- "name": "changeOwner",
82
- "outputs": [],
83
- "stateMutability": "nonpayable",
138
+ "stateMutability": "view",
84
139
  "type": "function"
85
140
  },
86
141
  {
@@ -141,43 +196,6 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
141
196
  "stateMutability": "nonpayable",
142
197
  "type": "function"
143
198
  },
144
- {
145
- "inputs": [
146
- {
147
- "internalType": "address",
148
- "name": "_treaseryAddress",
149
- "type": "address"
150
- }
151
- ],
152
- "name": "setTreasery",
153
- "outputs": [],
154
- "stateMutability": "nonpayable",
155
- "type": "function"
156
- },
157
- {
158
- "inputs": [
159
- {
160
- "internalType": "address",
161
- "name": "_trassary",
162
- "type": "address"
163
- }
164
- ],
165
- "stateMutability": "nonpayable",
166
- "type": "constructor"
167
- },
168
- {
169
- "anonymous": false,
170
- "inputs": [
171
- {
172
- "indexed": false,
173
- "internalType": "bytes32",
174
- "name": "id",
175
- "type": "bytes32"
176
- }
177
- ],
178
- "name": "ChequeCreated",
179
- "type": "event"
180
- },
181
199
  {
182
200
  "inputs": [
183
201
  {
@@ -207,68 +225,15 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
207
225
  "stateMutability": "payable",
208
226
  "type": "function"
209
227
  },
210
- {
211
- "anonymous": false,
212
- "inputs": [
213
- {
214
- "indexed": true,
215
- "internalType": "bytes32",
216
- "name": "id",
217
- "type": "bytes32"
218
- }
219
- ],
220
- "name": "redeem",
221
- "type": "event"
222
- },
223
228
  {
224
229
  "inputs": [
225
- {
226
- "internalType": "uint256",
227
- "name": "_minFee",
228
- "type": "uint256"
229
- },
230
- {
231
- "internalType": "uint256",
232
- "name": "_maxFees",
233
- "type": "uint256"
234
- },
235
- {
236
- "internalType": "uint256",
237
- "name": "_minEth",
238
- "type": "uint256"
239
- },
240
- {
241
- "internalType": "uint256",
242
- "name": "_baseFee",
243
- "type": "uint256"
244
- }
245
- ],
246
- "name": "setFees",
247
- "outputs": [],
248
- "stateMutability": "nonpayable",
249
- "type": "function"
250
- },
251
- {
252
- "inputs": [
253
- {
254
- "internalType": "uint256",
255
- "name": "amount",
256
- "type": "uint256"
257
- },
258
230
  {
259
231
  "internalType": "address",
260
- "name": "_to",
232
+ "name": "newOwner",
261
233
  "type": "address"
262
234
  }
263
235
  ],
264
- "name": "withdrawAmount",
265
- "outputs": [],
266
- "stateMutability": "nonpayable",
267
- "type": "function"
268
- },
269
- {
270
- "inputs": [],
271
- "name": "withdrawFees",
236
+ "name": "changeOwner",
272
237
  "outputs": [],
273
238
  "stateMutability": "nonpayable",
274
239
  "type": "function"
@@ -286,19 +251,6 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
286
251
  "stateMutability": "view",
287
252
  "type": "function"
288
253
  },
289
- {
290
- "inputs": [],
291
- "name": "FEE_DENOMINATOR",
292
- "outputs": [
293
- {
294
- "internalType": "uint256",
295
- "name": "",
296
- "type": "uint256"
297
- }
298
- ],
299
- "stateMutability": "view",
300
- "type": "function"
301
- },
302
254
  {
303
255
  "inputs": [],
304
256
  "name": "feeBasisPoints",
@@ -331,6 +283,11 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
331
283
  "internalType": "bytes32",
332
284
  "name": "id",
333
285
  "type": "bytes32"
286
+ },
287
+ {
288
+ "internalType": "address",
289
+ "name": "from",
290
+ "type": "address"
334
291
  }
335
292
  ],
336
293
  "name": "getChequeInfo",
@@ -344,6 +301,11 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
344
301
  "internalType": "address payable[]",
345
302
  "name": "to",
346
303
  "type": "address[]"
304
+ },
305
+ {
306
+ "internalType": "bool",
307
+ "name": "claimed",
308
+ "type": "bool"
347
309
  }
348
310
  ],
349
311
  "stateMutability": "view",
@@ -394,38 +356,63 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
394
356
  "internalType": "uint256",
395
357
  "name": "amountOut",
396
358
  "type": "uint256"
359
+ },
360
+ {
361
+ "internalType": "address",
362
+ "name": "spender",
363
+ "type": "address"
364
+ },
365
+ {
366
+ "internalType": "address",
367
+ "name": "receiver",
368
+ "type": "address"
369
+ },
370
+ {
371
+ "internalType": "bool",
372
+ "name": "claimed",
373
+ "type": "bool"
397
374
  }
398
375
  ],
399
376
  "stateMutability": "view",
400
377
  "type": "function"
401
378
  },
402
379
  {
403
- "inputs": [],
404
- "name": "getTreasery",
380
+ "inputs": [
381
+ {
382
+ "internalType": "bytes32",
383
+ "name": "id",
384
+ "type": "bytes32"
385
+ }
386
+ ],
387
+ "name": "getTokenChequeDetail",
405
388
  "outputs": [
406
389
  {
407
390
  "internalType": "address",
408
- "name": "",
391
+ "name": "spender",
409
392
  "type": "address"
393
+ },
394
+ {
395
+ "internalType": "address",
396
+ "name": "receiver",
397
+ "type": "address"
398
+ },
399
+ {
400
+ "internalType": "bool",
401
+ "name": "claimed",
402
+ "type": "bool"
410
403
  }
411
404
  ],
412
405
  "stateMutability": "view",
413
406
  "type": "function"
414
407
  },
415
408
  {
416
- "inputs": [
417
- {
418
- "internalType": "address",
419
- "name": "_addrr",
420
- "type": "address"
421
- }
422
- ],
423
- "name": "getUserChequeCount",
409
+ "inputs": [],
410
+ "name": "getTreasery",
424
411
  "outputs": [
425
412
  {
426
- "internalType": "uint256",
413
+ "internalType": "address",
427
414
  "name": "",
428
- "type": "uint256"
415
+ "type": "address"
429
416
  }
430
417
  ],
431
418
  "stateMutability": "view",
@@ -476,6 +463,78 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
476
463
  "stateMutability": "view",
477
464
  "type": "function"
478
465
  },
466
+ {
467
+ "inputs": [
468
+ {
469
+ "internalType": "uint256",
470
+ "name": "_minFee",
471
+ "type": "uint256"
472
+ },
473
+ {
474
+ "internalType": "uint256",
475
+ "name": "_maxFees",
476
+ "type": "uint256"
477
+ },
478
+ {
479
+ "internalType": "uint256",
480
+ "name": "_minEth",
481
+ "type": "uint256"
482
+ },
483
+ {
484
+ "internalType": "uint256",
485
+ "name": "_baseFee",
486
+ "type": "uint256"
487
+ }
488
+ ],
489
+ "name": "setFees",
490
+ "outputs": [],
491
+ "stateMutability": "nonpayable",
492
+ "type": "function"
493
+ },
494
+ {
495
+ "inputs": [
496
+ {
497
+ "internalType": "uint256",
498
+ "name": "_TokenChequepercentage",
499
+ "type": "uint256"
500
+ },
501
+ {
502
+ "internalType": "uint256",
503
+ "name": "_SwapTokenChequepercentage",
504
+ "type": "uint256"
505
+ }
506
+ ],
507
+ "name": "setTokenFees",
508
+ "outputs": [],
509
+ "stateMutability": "nonpayable",
510
+ "type": "function"
511
+ },
512
+ {
513
+ "inputs": [
514
+ {
515
+ "internalType": "address",
516
+ "name": "_treaseryAddress",
517
+ "type": "address"
518
+ }
519
+ ],
520
+ "name": "setTreasery",
521
+ "outputs": [],
522
+ "stateMutability": "nonpayable",
523
+ "type": "function"
524
+ },
525
+ {
526
+ "inputs": [],
527
+ "name": "swapBasicPoints",
528
+ "outputs": [
529
+ {
530
+ "internalType": "uint256",
531
+ "name": "",
532
+ "type": "uint256"
533
+ }
534
+ ],
535
+ "stateMutability": "view",
536
+ "type": "function"
537
+ },
479
538
  {
480
539
  "inputs": [
481
540
  {
@@ -537,10 +596,44 @@ __SHADOWPAY_ABI__ERC20__= json.loads("""[
537
596
  ],
538
597
  "stateMutability": "view",
539
598
  "type": "function"
599
+ },
600
+ {
601
+ "inputs": [
602
+ {
603
+ "internalType": "uint256",
604
+ "name": "amount",
605
+ "type": "uint256"
606
+ },
607
+ {
608
+ "internalType": "address",
609
+ "name": "_to",
610
+ "type": "address"
611
+ }
612
+ ],
613
+ "name": "withdrawAmount",
614
+ "outputs": [],
615
+ "stateMutability": "nonpayable",
616
+ "type": "function"
617
+ },
618
+ {
619
+ "inputs": [],
620
+ "name": "withdrawFees",
621
+ "outputs": [],
622
+ "stateMutability": "nonpayable",
623
+ "type": "function"
540
624
  }
541
625
  ]""")
542
626
 
543
627
  __SHADOWPAY_ABI__ERC721__ = json.loads("""[]""")
544
628
  __SHADOWPAY_CONTRACT_ADDRESS__ERC721__ = {
545
629
  "0x1": "0x3c5b8d6f2e"
546
- }
630
+ }
631
+
632
+ SOLANA_SYSTEM_PROGRAMM = "11111111111111111111111111111111"
633
+ LAMPORTS_PER_SOL = 1_000_000_000
634
+ WRAPED_SOL = "So11111111111111111111111111111111111111112"
635
+ TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
636
+ NATIVE_DECIMALS: int = 9
637
+ PROGRAM_ID = Pubkey.from_string("CrfYLvU4FdVjkBno2rRi6u5U6nGCykpQnQKSBg3uVXTw")
638
+
639
+ CONFIG_PDA=Pubkey.find_program_address([b"config"], PROGRAM_ID)
@@ -1,4 +1,4 @@
1
1
  from .erc20 import ERC20Token as ERC20
2
2
  from .erc721 import ERC721Token as ERC721
3
- from .sol import SolTokens as SPL
4
- __all__ = ["ERC20", "ERC721", "SPL"]
3
+ from .sol import SOL as sol
4
+ __all__ = ["ERC20", "ERC721", "sol"]