shadowPaySDK 0.1.0__py3-none-any.whl → 0.1__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/__init__.py CHANGED
@@ -1,2 +1,27 @@
1
- from erc20 import ERC20Token as ERC20
2
- from erc721 import ERC721Token as ERC721
1
+ import json
2
+ from shadowPaySDK.interface.erc20 import ERC20Token
3
+ from shadowPaySDK.interface.erc721 import ERC721Token
4
+ from shadowPaySDK.interface.sol import SOL as sol
5
+ from shadowPaySDK.types.EVMcheque import Cheque
6
+ from shadowPaySDK.types.SOLcheque import SOLCheque
7
+ from shadowPaySDK.const import __ERC20_ABI__, __SHADOWPAY_ABI__ERC20__,__ALLOW_CHAINS__, __SHADOWPAY_CONTRACT_ADDRESS__ERC20__
8
+
9
+
10
+ # from shadowPaySDK.utils import parse_tx as PARSE_TX
11
+
12
+ __all__ = [
13
+ "ERC20",
14
+ "ERC721",
15
+ "PARSE_TX",
16
+ "Cheque",
17
+ "SOLCheque",
18
+ "SOL",
19
+ "SolTokens",
20
+ "__SHADOWPAY_ABI__ERC20__",
21
+ "__ERC20_ABI__ ",
22
+ "create_cheque",
23
+ "get_my_cheques"
24
+
25
+ ]
26
+
27
+
shadowPaySDK/const.py ADDED
@@ -0,0 +1,639 @@
1
+ import json
2
+ from solders.pubkey import Pubkey
3
+ __ALLOW_CHAINS__ = [
4
+ 56, # BSC Mainnet
5
+ 97, # BSC Testnet
6
+ 10143,
7
+ 0x1,
8
+ 0x1f984,
9
+ 0x38,
10
+ 0x66eed,
11
+ 0x89,
12
+ 0xa
13
+ ]
14
+
15
+
16
+
17
+
18
+ __VERSION__ = "0.1.2"
19
+
20
+
21
+ __ERC20_ABI__ = json.loads("""[
22
+ {"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"type":"function"},
23
+ {"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"type":"function"},
24
+ {"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"type":"function"},
25
+ {"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"type":"function"},
26
+ {"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"type":"function"},
27
+ {"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"type":"function"},
28
+ {"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"type":"function"},
29
+ {"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"type":"function"},
30
+ {"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"", "type":"bool"}],"type":"function"}
31
+ ]""")
32
+
33
+ __SHADOWPAY_CONTRACT_ADDRESS__ERC20__ = {
34
+ 97: "0x5487C0DdCbD5465F26B446c6CAB88D8d6F7DF23b",
35
+ 10143: "0x1d856f2eA4738d1a89E27dbfc8950a4976Db41a5"
36
+ }
37
+
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
+ },
89
+ {
90
+ "inputs": [
91
+ {
92
+ "internalType": "bytes32",
93
+ "name": "groupIdv1",
94
+ "type": "bytes32"
95
+ }
96
+ ],
97
+ "name": "CashOutCheque",
98
+ "outputs": [],
99
+ "stateMutability": "nonpayable",
100
+ "type": "function"
101
+ },
102
+ {
103
+ "inputs": [
104
+ {
105
+ "internalType": "bytes32",
106
+ "name": "_id",
107
+ "type": "bytes32"
108
+ }
109
+ ],
110
+ "name": "CashOutSwapCheque",
111
+ "outputs": [],
112
+ "stateMutability": "nonpayable",
113
+ "type": "function"
114
+ },
115
+ {
116
+ "inputs": [
117
+ {
118
+ "internalType": "bytes32",
119
+ "name": "id",
120
+ "type": "bytes32"
121
+ }
122
+ ],
123
+ "name": "CashOutTokenCheque",
124
+ "outputs": [],
125
+ "stateMutability": "nonpayable",
126
+ "type": "function"
127
+ },
128
+ {
129
+ "inputs": [],
130
+ "name": "FEE_DENOMINATOR",
131
+ "outputs": [
132
+ {
133
+ "internalType": "uint256",
134
+ "name": "",
135
+ "type": "uint256"
136
+ }
137
+ ],
138
+ "stateMutability": "view",
139
+ "type": "function"
140
+ },
141
+ {
142
+ "inputs": [
143
+ {
144
+ "internalType": "address payable[]",
145
+ "name": "_to",
146
+ "type": "address[]"
147
+ }
148
+ ],
149
+ "name": "InitCheque",
150
+ "outputs": [
151
+ {
152
+ "internalType": "bytes32",
153
+ "name": "groupIdv1",
154
+ "type": "bytes32"
155
+ }
156
+ ],
157
+ "stateMutability": "payable",
158
+ "type": "function"
159
+ },
160
+ {
161
+ "inputs": [
162
+ {
163
+ "internalType": "address",
164
+ "name": "_reciever",
165
+ "type": "address"
166
+ },
167
+ {
168
+ "internalType": "address",
169
+ "name": "_tokenIn",
170
+ "type": "address"
171
+ },
172
+ {
173
+ "internalType": "uint256",
174
+ "name": "_amountIn",
175
+ "type": "uint256"
176
+ },
177
+ {
178
+ "internalType": "address",
179
+ "name": "_tokenOut",
180
+ "type": "address"
181
+ },
182
+ {
183
+ "internalType": "uint256",
184
+ "name": "_amountOut",
185
+ "type": "uint256"
186
+ }
187
+ ],
188
+ "name": "InitSwapCheque",
189
+ "outputs": [
190
+ {
191
+ "internalType": "bytes32",
192
+ "name": "chequeId",
193
+ "type": "bytes32"
194
+ }
195
+ ],
196
+ "stateMutability": "nonpayable",
197
+ "type": "function"
198
+ },
199
+ {
200
+ "inputs": [
201
+ {
202
+ "internalType": "address",
203
+ "name": "tokenAddrr",
204
+ "type": "address"
205
+ },
206
+ {
207
+ "internalType": "uint256",
208
+ "name": "amount",
209
+ "type": "uint256"
210
+ },
211
+ {
212
+ "internalType": "address payable",
213
+ "name": "to",
214
+ "type": "address"
215
+ }
216
+ ],
217
+ "name": "InitTokenCheque",
218
+ "outputs": [
219
+ {
220
+ "internalType": "bytes32",
221
+ "name": "",
222
+ "type": "bytes32"
223
+ }
224
+ ],
225
+ "stateMutability": "payable",
226
+ "type": "function"
227
+ },
228
+ {
229
+ "inputs": [
230
+ {
231
+ "internalType": "address",
232
+ "name": "newOwner",
233
+ "type": "address"
234
+ }
235
+ ],
236
+ "name": "changeOwner",
237
+ "outputs": [],
238
+ "stateMutability": "nonpayable",
239
+ "type": "function"
240
+ },
241
+ {
242
+ "inputs": [],
243
+ "name": "collectedFees",
244
+ "outputs": [
245
+ {
246
+ "internalType": "uint256",
247
+ "name": "",
248
+ "type": "uint256"
249
+ }
250
+ ],
251
+ "stateMutability": "view",
252
+ "type": "function"
253
+ },
254
+ {
255
+ "inputs": [],
256
+ "name": "feeBasisPoints",
257
+ "outputs": [
258
+ {
259
+ "internalType": "uint256",
260
+ "name": "",
261
+ "type": "uint256"
262
+ }
263
+ ],
264
+ "stateMutability": "view",
265
+ "type": "function"
266
+ },
267
+ {
268
+ "inputs": [],
269
+ "name": "getBalance",
270
+ "outputs": [
271
+ {
272
+ "internalType": "uint256",
273
+ "name": "",
274
+ "type": "uint256"
275
+ }
276
+ ],
277
+ "stateMutability": "view",
278
+ "type": "function"
279
+ },
280
+ {
281
+ "inputs": [
282
+ {
283
+ "internalType": "bytes32",
284
+ "name": "id",
285
+ "type": "bytes32"
286
+ },
287
+ {
288
+ "internalType": "address",
289
+ "name": "from",
290
+ "type": "address"
291
+ }
292
+ ],
293
+ "name": "getChequeInfo",
294
+ "outputs": [
295
+ {
296
+ "internalType": "uint256",
297
+ "name": "amount",
298
+ "type": "uint256"
299
+ },
300
+ {
301
+ "internalType": "address payable[]",
302
+ "name": "to",
303
+ "type": "address[]"
304
+ },
305
+ {
306
+ "internalType": "bool",
307
+ "name": "claimed",
308
+ "type": "bool"
309
+ }
310
+ ],
311
+ "stateMutability": "view",
312
+ "type": "function"
313
+ },
314
+ {
315
+ "inputs": [],
316
+ "name": "getCollectedFee",
317
+ "outputs": [
318
+ {
319
+ "internalType": "uint256",
320
+ "name": "",
321
+ "type": "uint256"
322
+ }
323
+ ],
324
+ "stateMutability": "view",
325
+ "type": "function"
326
+ },
327
+ {
328
+ "inputs": [],
329
+ "name": "getOwner",
330
+ "outputs": [
331
+ {
332
+ "internalType": "address",
333
+ "name": "",
334
+ "type": "address"
335
+ }
336
+ ],
337
+ "stateMutability": "view",
338
+ "type": "function"
339
+ },
340
+ {
341
+ "inputs": [
342
+ {
343
+ "internalType": "bytes32",
344
+ "name": "id",
345
+ "type": "bytes32"
346
+ }
347
+ ],
348
+ "name": "getSwapDetail",
349
+ "outputs": [
350
+ {
351
+ "internalType": "address",
352
+ "name": "tokenOut",
353
+ "type": "address"
354
+ },
355
+ {
356
+ "internalType": "uint256",
357
+ "name": "amountOut",
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"
374
+ }
375
+ ],
376
+ "stateMutability": "view",
377
+ "type": "function"
378
+ },
379
+ {
380
+ "inputs": [
381
+ {
382
+ "internalType": "bytes32",
383
+ "name": "id",
384
+ "type": "bytes32"
385
+ }
386
+ ],
387
+ "name": "getTokenChequeDetail",
388
+ "outputs": [
389
+ {
390
+ "internalType": "address",
391
+ "name": "spender",
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"
403
+ }
404
+ ],
405
+ "stateMutability": "view",
406
+ "type": "function"
407
+ },
408
+ {
409
+ "inputs": [],
410
+ "name": "getTreasery",
411
+ "outputs": [
412
+ {
413
+ "internalType": "address",
414
+ "name": "",
415
+ "type": "address"
416
+ }
417
+ ],
418
+ "stateMutability": "view",
419
+ "type": "function"
420
+ },
421
+ {
422
+ "inputs": [],
423
+ "name": "nextAvailableWithdraw",
424
+ "outputs": [
425
+ {
426
+ "internalType": "uint256",
427
+ "name": "timestamp",
428
+ "type": "uint256"
429
+ }
430
+ ],
431
+ "stateMutability": "view",
432
+ "type": "function"
433
+ },
434
+ {
435
+ "inputs": [
436
+ {
437
+ "internalType": "address",
438
+ "name": "",
439
+ "type": "address"
440
+ }
441
+ ],
442
+ "name": "nonces",
443
+ "outputs": [
444
+ {
445
+ "internalType": "uint256",
446
+ "name": "",
447
+ "type": "uint256"
448
+ }
449
+ ],
450
+ "stateMutability": "view",
451
+ "type": "function"
452
+ },
453
+ {
454
+ "inputs": [],
455
+ "name": "owner",
456
+ "outputs": [
457
+ {
458
+ "internalType": "address",
459
+ "name": "",
460
+ "type": "address"
461
+ }
462
+ ],
463
+ "stateMutability": "view",
464
+ "type": "function"
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
+ },
538
+ {
539
+ "inputs": [
540
+ {
541
+ "internalType": "bytes32",
542
+ "name": "",
543
+ "type": "bytes32"
544
+ }
545
+ ],
546
+ "name": "swapCheques",
547
+ "outputs": [
548
+ {
549
+ "internalType": "address",
550
+ "name": "spender",
551
+ "type": "address"
552
+ },
553
+ {
554
+ "internalType": "address",
555
+ "name": "receiver",
556
+ "type": "address"
557
+ },
558
+ {
559
+ "internalType": "address",
560
+ "name": "tokenIn",
561
+ "type": "address"
562
+ },
563
+ {
564
+ "internalType": "uint256",
565
+ "name": "amountIn",
566
+ "type": "uint256"
567
+ },
568
+ {
569
+ "internalType": "address",
570
+ "name": "tokenOut",
571
+ "type": "address"
572
+ },
573
+ {
574
+ "internalType": "uint256",
575
+ "name": "amountOut",
576
+ "type": "uint256"
577
+ },
578
+ {
579
+ "internalType": "bool",
580
+ "name": "claimed",
581
+ "type": "bool"
582
+ }
583
+ ],
584
+ "stateMutability": "view",
585
+ "type": "function"
586
+ },
587
+ {
588
+ "inputs": [],
589
+ "name": "treasery",
590
+ "outputs": [
591
+ {
592
+ "internalType": "address",
593
+ "name": "",
594
+ "type": "address"
595
+ }
596
+ ],
597
+ "stateMutability": "view",
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"
624
+ }
625
+ ]""")
626
+
627
+ __SHADOWPAY_ABI__ERC721__ = json.loads("""[]""")
628
+ __SHADOWPAY_CONTRACT_ADDRESS__ERC721__ = {
629
+ "0x1": "0x3c5b8d6f2e"
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)
@@ -0,0 +1,4 @@
1
+ from .erc20 import ERC20Token as ERC20
2
+ from .erc721 import ERC721Token as ERC721
3
+ from .sol import SOL as sol
4
+ __all__ = ["ERC20", "ERC721", "sol"]