Skip to content

Commit 505b721

Browse files
authored
Merge branch 'master' into feature/transaction
2 parents 0c2726d + 65d06c9 commit 505b721

File tree

17 files changed

+98
-209
lines changed

17 files changed

+98
-209
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env/
99
venv/
1010
env3/
1111
.ipynb_checkpoints
12-
12+
package_test/
1313
.history/*
1414

1515

docs/pages/models/transaction/instructions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ This is a named tuple representing an instruction object. Here keys are `Account
230230
<Code>
231231
```python
232232
class Instruction(NamedTuple):
233-
keys: list[AccountMeta]
233+
keys: List[AccountMeta]
234234
program_id: PublicKey
235235
data: bytes = bytes(0)
236236
```

docs/pages/utility/functions.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The message argument is optional, when not provided the public key itself is use
3535
```python
3636
def verify_signature(
3737
public_key: PublicKey | str,
38-
signature: list[int],
38+
signature: List[int],
3939
message: str | bytes | None = None
4040
)
4141
```
@@ -50,7 +50,7 @@ from nacl.exceptions import BadSignatureError
5050

5151
# Getting the public key and the signature array
5252
public_key: str = request.headers.get("public_key")
53-
signature_array: list[int] = request.headers.get("signature")
53+
signature_array: List[int] = request.headers.get("signature")
5454

5555
try:
5656
verify_signature(public_key, signature_array)

poetry.lock

Lines changed: 44 additions & 155 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "solathon"
3-
version = "1.0.4"
3+
version = "1.0.5"
44
description = "High performance, easy to use and feature-rich Solana SDK for Python."
55
license = "MIT"
66
authors = ["GitBolt"]
@@ -22,13 +22,13 @@ classifiers = [
2222

2323
[tool.poetry.dependencies]
2424
python = "^3.8"
25-
httpx = "^0.22.0"
2625
PyNaCl = "^1.5.0"
2726
base58 = "^2.1.1"
2827
construct = "^2.10.67"
2928
typing-extensions = { version = "^4.1.1", python = "3.10" }
3029
qrcode = "^7.4.2"
3130
pillow = "^10.2.0"
31+
httpx = "^0.27.2"
3232

3333
[tool.poetry.dev-dependencies]
3434
jedi = "^0.18.1"

solathon/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.0.4"
1+
__version__ = "1.0.5"
22

33
from .client import Client
44
from .async_client import AsyncClient

solathon/async_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ async def get_inflation_reward(self, addresses: List[Text]) -> RPCResponse:
250250
Get the inflation reward for a list of addresses.
251251
252252
Args:
253-
addresses (list[Text]): A list of addresses to get the inflation reward for.
253+
addresses (List[Text]): A list of addresses to get the inflation reward for.
254254
255255
Returns:
256256
RPCResponse: The response from the RPC server.
@@ -362,12 +362,12 @@ async def get_signatures_for_address(self, acct_address: Text) -> RPCResponse:
362362
"getSignaturesForAddress", [acct_address]
363363
)
364364

365-
async def get_signature_statuses(self, transaction_sigs: list[Text]) -> RPCResponse:
365+
async def get_signature_statuses(self, transaction_sigs: List[Text]) -> RPCResponse:
366366
"""
367367
Returns the current status of a list of signatures.
368368
369369
Args:
370-
transaction_sigs (list[str]): List of transaction signatures to check status for.
370+
transaction_sigs (List[str]): List of transaction signatures to check status for.
371371
372372
Returns:
373373
RPCResponse: Response object containing the status of the signatures.
@@ -518,6 +518,6 @@ async def build_and_send_request_async(
518518
Returns:
519519
RPCResponse: The response from the server.
520520
"""
521-
data: dict[Text, Any] = self.http.build_data(method=method, params=params)
521+
data: Dict[Text, Any] = self.http.build_data(method=method, params=params)
522522
res: RPCResponse = await self.http.send(data)
523523
return res

solathon/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def get_inflation_reward(
389389
Returns the inflation reward for the specified addresses.
390390
391391
Args:
392-
addresses (list[str]): The addresses.
392+
addresses (List[str]): The addresses.
393393
commitment (Commitment, optional): The level of commitment desired when querying state.
394394
395395
Returns:
@@ -419,7 +419,7 @@ def get_largest_accounts(
419419
def get_leader_schedule(
420420
self,
421421
) -> (
422-
RPCResponse[dict[str, Union[List[int], Any]]] | dict[str, Union[List[int], Any]]
422+
RPCResponse[Dict[str, Union[List[int], Any]]] | Dict[str, Union[List[int], Any]]
423423
):
424424
"""
425425
Returns the leader schedule.
@@ -580,7 +580,7 @@ def get_signature_statuses(
580580
Returns the signature statuses for the specified transaction signatures.
581581
582582
Args:
583-
transaction_sigs (list[str]): The transaction signatures.
583+
transaction_sigs (List[str]): The transaction signatures.
584584
585585
Returns:
586586
RPCResponse: The response from the RPC endpoint.
@@ -715,7 +715,7 @@ def get_transaction(
715715

716716
def build_and_send_request(
717717
self, method, params: List[Any]
718-
) -> RPCResponse | dict[str, Any] | List[dict[str, Any]]:
718+
) -> RPCResponse | Dict[str, Any] | List[Dict[str, Any]]:
719719
"""
720720
Builds and sends an RPC request to the server.
721721
@@ -726,7 +726,7 @@ def build_and_send_request(
726726
Returns:
727727
RPCResponse: The response from the server.
728728
"""
729-
data: dict[str, Any] = self.http.build_data(method=method, params=params)
729+
data: Dict[str, Any] = self.http.build_data(method=method, params=params)
730730
res: RPCResponse = self.http.send(data)
731731
if self.clean_response:
732732
if "error" in res:

solathon/core/http.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import asyncio
55
import base64
66
import httpx
7-
from typing import Any
7+
from typing import Any, List, Dict
88

99

1010
from .. import __version__
@@ -27,14 +27,14 @@ def __init__(self, endpoint: str):
2727
self.request_id = 0
2828
self.client = httpx.Client()
2929

30-
def send(self, data: dict[str, Any]) -> RPCResponse:
30+
def send(self, data: Dict[str, Any]) -> RPCResponse:
3131
res = self.client.post(
3232
url=self.endpoint, headers=self.headers, json=data)
3333
return res.json()
3434

35-
def build_data(self, method: str, params: list[Any]) -> dict[str, Any]:
35+
def build_data(self, method: str, params: List[Any]) -> Dict[str, Any]:
3636
self.request_id += 1
37-
params: list[Any] = [
37+
params: List[Any] = [
3838
str(i) if isinstance(i, PublicKey) else i for i in params
3939
]
4040

@@ -72,14 +72,14 @@ def __init__(self, endpoint: str):
7272
self.client = httpx.AsyncClient()
7373

7474

75-
async def send(self, data: dict[str, Any]) -> RPCResponse:
75+
async def send(self, data: Dict[str, Any]) -> RPCResponse:
7676
res = await self.client.post(
7777
url=self.endpoint, headers=self.headers, json=data)
7878
return res.json()
7979

80-
def build_data(self, method: str, params: list[Any]) -> dict[str, Any]:
80+
def build_data(self, method: str, params: List[Any]) -> Dict[str, Any]:
8181
self.request_id += 1
82-
params: list[Any] = [
82+
params: List[Any] = [
8383
str(i) if isinstance(i, PublicKey) else i for i in params
8484
]
8585

solathon/core/instructions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Developer reference: https://github.com/solana-labs/solana/blob/master/sdk/program/src/system_instruction.rs
22
from __future__ import annotations
33

4-
from typing import NamedTuple
4+
from typing import NamedTuple, List
55
from dataclasses import dataclass
66
from ..publickey import PublicKey
77
from ..core.layouts import (
@@ -19,7 +19,7 @@ class AccountMeta:
1919

2020

2121
class Instruction(NamedTuple):
22-
keys: list[AccountMeta]
22+
keys: List[AccountMeta]
2323
program_id: PublicKey
2424
data: bytes = bytes(0)
2525

@@ -44,7 +44,7 @@ def create_account(
4444
space: int,
4545
program_id: PublicKey
4646
) -> Instruction:
47-
account_metas: list[AccountMeta] = [
47+
account_metas: List[AccountMeta] = [
4848
AccountMeta(
4949
public_key=from_public_key,
5050
is_signer=True,
@@ -81,7 +81,7 @@ def create_account_with_seed(
8181
space: int,
8282
program_id: PublicKey
8383
) -> Instruction:
84-
account_metas: list[AccountMeta] = [
84+
account_metas: List[AccountMeta] = [
8585
AccountMeta(
8686
public_key=from_public_key,
8787
is_signer=True,
@@ -149,7 +149,7 @@ def transfer(
149149
to_public_key: PublicKey | str,
150150
lamports: int
151151
) -> Instruction:
152-
account_metas: list[AccountMeta] = [
152+
account_metas: List[AccountMeta] = [
153153
AccountMeta(
154154
public_key=from_public_key,
155155
is_signer=True,

0 commit comments

Comments
 (0)