shadowPaySDK 0.2.0.22__py3-none-any.whl → 0.2.0.24__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/interface/sol.py +6 -4
- {shadowpaysdk-0.2.0.22.dist-info → shadowpaysdk-0.2.0.24.dist-info}/METADATA +1 -1
- {shadowpaysdk-0.2.0.22.dist-info → shadowpaysdk-0.2.0.24.dist-info}/RECORD +6 -6
- {shadowpaysdk-0.2.0.22.dist-info → shadowpaysdk-0.2.0.24.dist-info}/WHEEL +0 -0
- {shadowpaysdk-0.2.0.22.dist-info → shadowpaysdk-0.2.0.24.dist-info}/licenses/LICENSE +0 -0
- {shadowpaysdk-0.2.0.22.dist-info → shadowpaysdk-0.2.0.24.dist-info}/top_level.txt +0 -0
shadowPaySDK/interface/sol.py
CHANGED
@@ -7,6 +7,8 @@ import spl
|
|
7
7
|
import spl.token
|
8
8
|
import spl.token.constants
|
9
9
|
from spl.token.instructions import get_associated_token_address, create_associated_token_account, transfer, close_account, TransferParams
|
10
|
+
from solders.system_program import transfer as ts
|
11
|
+
from solders.system_program import TransferParams as tsf
|
10
12
|
from spl.token.constants import TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID
|
11
13
|
from solana.rpc.types import TxOpts, TokenAccountOpts
|
12
14
|
from solana.rpc.types import TxOpts
|
@@ -34,9 +36,9 @@ import re
|
|
34
36
|
LAMPORTS_PER_SOL = 1_000_000_000 # 1 SOL = 1,000,000,000 lamports
|
35
37
|
|
36
38
|
class SOL:
|
37
|
-
|
38
39
|
def __init__(self, rpc_url = "https://api.mainnet-beta.solana.com", KEYPAIR: Optional[Union[str, solders.keypair.Keypair]] = None,TOKEN_MINT: Optional[str] = None):
|
39
40
|
self.rpc_url = rpc_url
|
41
|
+
|
40
42
|
self.client = AsyncClient(rpc_url)
|
41
43
|
self.KEYPAIR = None
|
42
44
|
self.PROGRAM_ID = TOKEN_PROGRAM_ID # Default to the SPL Token Program ID
|
@@ -203,21 +205,21 @@ class SOL:
|
|
203
205
|
return resp.value
|
204
206
|
|
205
207
|
|
206
|
-
async def transfer_native(self, to:str, amount):
|
208
|
+
async def transfer_native(self, to:str, amount: int):
|
207
209
|
if not self.KEYPAIR:
|
208
210
|
raise ValueError("not set KEYPAIR.")
|
209
211
|
|
210
212
|
sender_pubkey = self.get_pubkey()
|
211
213
|
receiver_pubkey = solders.pubkey.Pubkey.from_string(to)
|
212
214
|
ixns = [
|
213
|
-
|
215
|
+
ts(tsf(
|
214
216
|
from_pubkey=sender_pubkey,
|
215
217
|
to_pubkey=receiver_pubkey,
|
216
218
|
lamports=amount * LAMPORTS_PER_SOL
|
217
219
|
))
|
218
220
|
]
|
219
221
|
msg = Message(ixns, self.get_pubkey())
|
220
|
-
latest_blockhash_resp = self.client.get_latest_blockhash()
|
222
|
+
latest_blockhash_resp = await self.client.get_latest_blockhash()
|
221
223
|
|
222
224
|
blockhash_str = latest_blockhash_resp.value.blockhash
|
223
225
|
tx = Transaction([self.KEYPAIR], msg, blockhash_str)
|
@@ -4,14 +4,14 @@ shadowPaySDK/const.py,sha256=uUkzYTm-12iK3IsnQICnoT9tpmZ9aYh3pqXbSd-GNh8,9898
|
|
4
4
|
shadowPaySDK/interface/__init__.py,sha256=ggSZCV22udnzXm_Wv_3x6VN3hNIAEiwgwHZc2Jwc688,146
|
5
5
|
shadowPaySDK/interface/erc20.py,sha256=7p8eU5LzhI2MsH80PZhq6IRhbfMGlNYucGl3OtyS9SI,4669
|
6
6
|
shadowPaySDK/interface/erc721.py,sha256=4AlWfDjrvl85wFocnN93j-oM54kTsLLwv9SdtcLj4eM,3094
|
7
|
-
shadowPaySDK/interface/sol.py,sha256=
|
7
|
+
shadowPaySDK/interface/sol.py,sha256=cgxPU-L6WJzvxKNLSO5KBkgl4JRyALv_OZiJmDjUJXc,8135
|
8
8
|
shadowPaySDK/types/EVMcheque.py,sha256=8M1EzpZGqf4uidrd9yDKiR7BvIl85p93A_9AMZtshSs,14570
|
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.
|
14
|
-
shadowpaysdk-0.2.0.
|
15
|
-
shadowpaysdk-0.2.0.
|
16
|
-
shadowpaysdk-0.2.0.
|
17
|
-
shadowpaysdk-0.2.0.
|
13
|
+
shadowpaysdk-0.2.0.24.dist-info/licenses/LICENSE,sha256=EG13vNmyBfkG3oKj40oOYfUGLKko8OouU6PfO6MlAk4,1066
|
14
|
+
shadowpaysdk-0.2.0.24.dist-info/METADATA,sha256=ON0djffBThRcRaMpv-317OD_8I2QpSdugGdZbhLz7VY,964
|
15
|
+
shadowpaysdk-0.2.0.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
shadowpaysdk-0.2.0.24.dist-info/top_level.txt,sha256=RSJc73GEf31NMdZp9KovEduzfhm10eQ2t5GTZ44aN1U,13
|
17
|
+
shadowpaysdk-0.2.0.24.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|