shadowPaySDK 0.2.0.9__py3-none-any.whl → 0.2.0.10__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.
@@ -1,6 +1,7 @@
1
1
  import asyncio
2
+ import solana
2
3
  from solana.rpc.async_api import AsyncClient, GetTokenAccountsByOwnerResp
3
- from solana.transaction import Transaction
4
+ from solders.transaction import Transaction
4
5
  from solders.system_program import TransferParams as p
5
6
  import spl
6
7
  import spl.token
@@ -203,6 +204,3 @@ class SOL:
203
204
 
204
205
 
205
206
 
206
- if __name__ == "__main__":
207
- newKeypair = solders.keypair.Keypair()
208
- print("New Keypair:", newKeypair)
@@ -7,18 +7,18 @@ import httpx
7
7
 
8
8
 
9
9
  class Cheque:
10
- def __init__(self, w3:Optional[Web3] = None,private_key:Optional[str] = None, ABI = __SHADOWPAY_ABI__ERC20__, allowed_chains = __ALLOW_CHAINS__):
10
+ def __init__(self, w3:Optional[Web3] = None,private_key:Optional[str] = None, ABI = __SHADOWPAY_ABI__ERC20__, allowed_chains = __ALLOW_CHAINS__, retunrn_build_tx:bool = False):
11
11
  self.w3 = w3
12
12
 
13
13
  self.amount = None
14
14
  self.token = None
15
15
  self.private_key = private_key
16
16
  self.ABI = ABI
17
-
17
+ self.return_build_tx = retunrn_build_tx
18
18
  self.allowed_chains = allowed_chains
19
19
  if self.w3 != None:
20
20
  self.__allow__()
21
-
21
+
22
22
  def __get__id(self, tx):
23
23
  try:
24
24
  logs = self.contract.events.ChequeCreated().process_receipt(tx)
@@ -80,6 +80,11 @@ class Cheque:
80
80
  'gasPrice': self.w3.eth.gas_price,
81
81
  'chainId': self.w3.eth.chain_id
82
82
  })
83
+ if self.return_build_tx:
84
+ return {
85
+ "build_tx": txn
86
+ }
87
+
83
88
  signed_txn = self.w3.eth.account.sign_transaction(txn, private_key or self.private_key)
84
89
  txn_hash = self.w3.eth.send_raw_transaction(signed_txn.raw_transaction)
85
90
  txn_receipt = self.w3.eth.wait_for_transaction_receipt(txn_hash)
@@ -121,6 +126,10 @@ class Cheque:
121
126
  'gas': 300_000,
122
127
  'gasPrice': self.w3.to_wei('5', 'gwei'),
123
128
  })
129
+ if self.return_build_tx:
130
+ return {
131
+ "build_tx": txn
132
+ }
124
133
 
125
134
  signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=private_key)
126
135
 
@@ -163,6 +172,10 @@ class Cheque:
163
172
  'gas': estimated_gas,
164
173
  'gasPrice': self.w3.eth.gas_price
165
174
  })
175
+ if self.return_build_tx:
176
+ return {
177
+ "build_tx": txn
178
+ }
166
179
  signed_txn = self.w3.eth.account.sign_transaction(txn, self.private_key)
167
180
  txn_hash = self.w3.eth.send_raw_transaction(signed_txn.raw_transaction)
168
181
  txn_receipt = self.w3.eth.wait_for_transaction_receipt(txn_hash)
@@ -201,6 +214,10 @@ class Cheque:
201
214
  'gas': estimated_gas,
202
215
  'gasPrice': self.w3.eth.gas_price,
203
216
  })
217
+ if self.return_build_tx:
218
+ return {
219
+ "build_tx": txn
220
+ }
204
221
 
205
222
  signed_txn = self.w3.eth.account.sign_transaction(txn, private_key=private_key)
206
223
  tx_hash = self.w3.eth.send_raw_transaction(signed_txn.raw_transaction)
@@ -247,6 +264,10 @@ class Cheque:
247
264
  'gas': estimated_gas,
248
265
  'gasPrice': self.w3.eth.gas_price
249
266
  })
267
+ if self.return_build_tx:
268
+ return {
269
+ "build_tx": txn
270
+ }
250
271
  signed_txn = self.w3.eth.account.sign_transaction(txn, self.private_key)
251
272
  txn_hash = self.w3.eth.send_raw_transaction(signed_txn.raw_transaction)
252
273
  txn_receipt = self.w3.eth.wait_for_transaction_receipt(txn_hash)
@@ -291,6 +312,10 @@ class Cheque:
291
312
  'gas': 300_000,
292
313
  'gasPrice': self.w3.eth.gas_price
293
314
  })
315
+ if self.return_build_tx:
316
+ return {
317
+ "build_tx": swa
318
+ }
294
319
  signed_txn = self.w3.eth.account.sign_transaction(swa, private_key=private_key)
295
320
  tx_hash = self.w3.eth.send_raw_transaction(signed_txn.raw_transaction)
296
321
  receipt = self.w3.eth.wait_for_transaction_receipt(tx_hash)
@@ -350,20 +375,3 @@ class NFTcheque:
350
375
 
351
376
 
352
377
 
353
- async def create_cheque(id, type, chain_id, receiver, sender):
354
- async with httpx.AsyncClient() as client:
355
- response = await client.post(
356
- __CREATE__CHEQUE__,
357
- json={
358
- "cheque_id": id,
359
- "chain_id":chain_id,
360
- "receiver": receiver,
361
- "type": type,
362
- "sender":sender
363
- }
364
- )
365
- if response.status_code == 200:
366
- return response.json()
367
- else:
368
- print(f"Failed to create cheque: {response.text}")
369
- return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shadowPaySDK
3
- Version: 0.2.0.9
3
+ Version: 0.2.0.10
4
4
  Summary: ShadowPay SDK for ERC20/ERC721 and P2P smart contract interaction
5
5
  Author: dazarius_
6
6
  Author-email: your@email.com
@@ -4,14 +4,14 @@ shadowPaySDK/const.py,sha256=T7TJPKFLqCtxwpUYO1AOryGMr65G-vVuotxfL8gWcME,9898
4
4
  shadowPaySDK/interface/__init__.py,sha256=ggSZCV22udnzXm_Wv_3x6VN3hNIAEiwgwHZc2Jwc688,146
5
5
  shadowPaySDK/interface/erc20.py,sha256=TIsek7ykuYsLMj5no-uastA5gYsIbk-F_Dq-5XPk_6w,4298
6
6
  shadowPaySDK/interface/erc721.py,sha256=4AlWfDjrvl85wFocnN93j-oM54kTsLLwv9SdtcLj4eM,3094
7
- shadowPaySDK/interface/sol.py,sha256=IKzG9b-XwMgCCH2GdmbVrNXvhwTJ0iUqlziFlQBQmKc,7322
8
- shadowPaySDK/types/EVMcheque.py,sha256=QjWuIKztb7MqnzFT82L6kWcxDgAkBxpSMrZ2a2Voa34,13676
7
+ shadowPaySDK/interface/sol.py,sha256=flMfmW14J4ybfVshUUTw6iklKa5x-zJzjxRi011XKXA,7230
8
+ shadowPaySDK/types/EVMcheque.py,sha256=qPJuj4nRZJXQ_BQZVDznoctX8k1J3iHJ5NqnBplPFk8,13798
9
9
  shadowPaySDK/types/SOLcheque.py,sha256=S6LnKxiWDj1KGRgFFAaHy03c7mxv4msaR-2cfVIhD2Y,818
10
10
  shadowPaySDK/types/__init__.py,sha256=sG6pNZfKGvENXqsnv6MrQtKrJ898fAXkMvAZY1k1-Qg,97
11
11
  shadowPaySDK/utils/__init__.py,sha256=aja3iYO4rT-ptMM-pzw0GRFTziBdXdcEi-4kE84zH64,61
12
12
  shadowPaySDK/utils/utils.py,sha256=g4bGvLDdjhNGsAj1eaZnNWFNaiN-cVhhM-5PrnG5aIQ,720
13
- shadowpaysdk-0.2.0.9.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
14
- shadowpaysdk-0.2.0.9.dist-info/METADATA,sha256=OMBbMZ95ekjJNO8_7JyW5VQtNBUWgN-szVIWs7PjnOw,839
15
- shadowpaysdk-0.2.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- shadowpaysdk-0.2.0.9.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
17
- shadowpaysdk-0.2.0.9.dist-info/RECORD,,
13
+ shadowpaysdk-0.2.0.10.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
14
+ shadowpaysdk-0.2.0.10.dist-info/METADATA,sha256=5ZSsfHb61aNWkjrI6neLGiniEaOegPuV0IZWeQkn29Y,840
15
+ shadowpaysdk-0.2.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ shadowpaysdk-0.2.0.10.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
17
+ shadowpaysdk-0.2.0.10.dist-info/RECORD,,