☄️ High performance, easy to use and feature-rich Solana SDK for Python.

Overview

Solathon logo

PyPI version DeepSource MIT License

Solathon

Solathon is an high performance, easy to use and feature-rich Solana SDK for Python. Easy for beginners, powerful for real world applications.

🧪 The project is in beta phase

Getting started

Installation

pip install solathon

Client example

from solathon import Client

client = Client("https://api.devnet.solana.com")

Basic usage example

# Basic example on generating a random public key and fetching it's balance
from solathon import Client, PublicKey

client = Client("https://api.devnet.solana.com")
public_key = PublicKey(1) # Creating a random public key

balance = client.get_balance(public_key)
print(balance)

🗃️ Contribution

Just drop a pull request lol

Comments
  • geeting this error in your examples

    geeting this error in your examples

    Traceback (most recent call last): File "c:\Users\hp\Desktop\fresh solana project\tester1.py", line 1, in from solathon import Client, Keypair File "C:\Users\hp\AppData\Local\Programs\Python\Python39\lib\site-packages\solathon_init_.py", line 3, in from .client import Client File "C:\Users\hp\AppData\Local\Programs\Python\Python39\lib\site-packages\solathon\client.py", line 7, in from .transaction import Transaction File "C:\Users\hp\AppData\Local\Programs\Python\Python39\lib\site-packages\solathon\transaction.py", line 9, in from .core.instructions import Instruction, AccountMeta File "C:\Users\hp\AppData\Local\Programs\Python\Python39\lib\site-packages\solathon\core\instructions.py", line 14, in class AccountMeta: File "C:\Users\hp\AppData\Local\Programs\Python\Python39\lib\site-packages\solathon\core\instructions.py", line 15, in AccountMeta public_key: PublicKey | str TypeError: unsupported operand type(s) for |: 'type' and 'type' PS C:\Users\hp\Desktop\fresh solana project>

    opened by Rachit-Pandey-2004 11
  • Fix default parameter from being a list to None.

    Fix default parameter from being a list to None.

    I believe this is an anti pattern in Python (#10) https://towardsdatascience.com/18-common-python-anti-patterns-i-wish-i-had-known-before-44d983805f0f

    Best to default to None and check for None in function body when defaulting to mutable objects.

    opened by DemetriBairaktaris 3
  • Type hint of `send()` input `data` should be `Dict[str, Any]`

    Type hint of `send()` input `data` should be `Dict[str, Any]`

    Current state

    File issolathon/core/http.py

      def send(self, data: str) -> Dict[str, Any]:
          res = httpx.post(url=self.endpoint, headers=self.headers, json=data)
          return res.json()
    

    Corrected input hint

      def send(self, data: Dict[str, Any]) -> Dict[str, Any]:
          res = httpx.post(url=self.endpoint, headers=self.headers, json=data)
          return res.json()
    

    This makes sense as send()takes the output of build_data(self, method: str, params: Tuple[Any]) -> Dict[str, Any]

    That said, res.json() from httpx seems to return typing.Any (source), so maybe that should be the return?

    This is a really cool project btw, I've been looking for a nice Python implementation to play with Solana, happy to contribute more as I go through the code :)

    opened by dineshpinto 2
  • ValueError when using a seed co create a keypair

    ValueError when using a seed co create a keypair

    Tried creating a keypair from a byte seed using solathon, but an error was returned : "ValueError: Invalid character '\x00' " was the error being returned Screenshot from 2022-07-09 15-48-06

    opened by chigozieokoroafor 0
  • Issues sending transaction to solana chain

    Issues sending transaction to solana chain

    I am trying to send a transaction to the Solana chain but I am not sure how to implement the instruction data i received from an NFT marketplace api.

    The instruction is in this format: {"tx": {"type": "Buffer","data": [ 1,0, 9,12,185,0,..........0]},"txSigned": {"type": "Buffer","data": [ 1, 0,0,.......0]}}

    How do I use this instruction data with Solathon to sign and successfully complete the transaction?

    opened by kasahh 0
Releases(0.1.2)
  • 0.1.2(Apr 22, 2022)

  • 0.0.9(Mar 7, 2022)

  • 0.0.8(Mar 7, 2022)

  • 0.0.7(Feb 17, 2022)

    • Better transaction object structure with more flexibility
    • Supporting six instructions now
    • Fix over 120 type hinting issues
    • Updated documentation with instructions and fixed async client mistakes
    Source code(tar.gz)
    Source code(zip)
  • 0.0.6(Feb 15, 2022)

  • 0.0.5(Feb 14, 2022)

    • Added AsyncClient
    • Improved HTTP performance
    • Added request_airdrop and refresh_http client methods
    • Added verify_signature utility function
    • Improved type hinting
    Source code(tar.gz)
    Source code(zip)
  • 0.0.4(Feb 10, 2022)

    • A lot of documentation
    • Added support for 10 more methods
    • Fixed keypair being printed whenever initializing
    • Improved type hinting
    • PEP8ified transaction.py and core/instructions.py
    Source code(tar.gz)
    Source code(zip)
  • 0.0.3(Feb 7, 2022)

    • Added support for four more methods
    • Added documentation
    • Handled error for methods without any parameters
    • Added endpoint attribute to client class
    Source code(tar.gz)
    Source code(zip)
  • 0.0.2(Jan 21, 2022)

    • Added transaction object and instructions
    • Added send transaction and fetching wallet tokens methods (sendTransaction & getTokenAccountsByOwner)
    • Improved key pair and public key objects
    • Initialized docs
    • Switch to Python 3.10 union type hinting
    Source code(tar.gz)
    Source code(zip)
  • 0.0.1(Jan 7, 2022)

    Initial release Contains the following:

    • Initial client with few basic RPC methods
    • Simple keypair encryption
    • Public key and Private key objects
    Source code(tar.gz)
    Source code(zip)
Owner
Bolt
Open source >>>>
Bolt
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async and await

Senpai Development 4 Nov 5, 2021
Low-level, feature rich and easy to use discord python wrapper

PWRCord Low-level, feature rich and easy to use discord python wrapper Important Note: At this point, this library API is considered unstable and can

MIguel Lopes 1 Dec 26, 2021
A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

disfork A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async a

null 2 Feb 9, 2022
A modern, easy to use, feature-rich, and async ready API wrapper improved and revived from original discord.py.

A Python API wrapper that is improved and revived from the original discord.py

Orion 19 Nov 6, 2021
Use Seaborn to visualize interpret the byte layout of Solana account types

solana-account-vis Use Seaborn to visually interpret the byte layout of Solana account types Usage from account_visualization import generate_account_

Jarry Xiao 15 Aug 25, 2022
A Discord Rich Presence App to set your own custom rich presence.

discord-rich-presence A Discord Rich Presence App to set your own custom rich presence. #BUILDS Ready to use package are available inside "finalpackag

null 1 Nov 22, 2021
Graviti-python-sdk - Graviti Data Platform Python SDK

Graviti Python SDK Graviti Python SDK is a python library to access Graviti Data

Graviti 13 Dec 15, 2022
A modern,feature-rich, and async ready API wrapper for Discord written in Python

discord.io A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using asyn

Vincent 18 Jan 2, 2023
Example code for interacting with solana anchor programs - candymachine

candypy example code for interacting with solana anchor programs - candymachine THIS IS PURELY SAMPLE CODE TO FORK, MODIFY, UNDERSTAND AND INTERACT WI

dubbelosix 3 Sep 18, 2022
SOLSEA-NFT-EXPLORE - Using Streamlit to build a simple UI on top of the Solana API

SOLSEA NFT Explorer Using Streamlit to build a simple UI on top of the Solana AP

Devin Capriola 3 Mar 19, 2022
A fast, distributed, high performance gradient boosting (GBT, GBDT, GBRT, GBM or MART) framework based on decision tree algorithms, used for ranking, classification and many other machine learning tasks.

Light Gradient Boosting Machine LightGBM is a gradient boosting framework that uses tree based learning algorithms. It is designed to be distributed a

Microsoft 14.5k Jan 8, 2023
BioThings API framework - Making high-performance API for biological annotation data

BioThings SDK Quick Summary BioThings SDK provides a Python-based toolkit to build high-performance data APIs (or web services) from a single data sou

BioThings 39 Jan 4, 2023
OpenEmu Discord Rich Presence provided with Python!

A simple application that provides your current OpenEmu game as an RPC state in Discord via PyPresence. How to use Unzip and open the latest x86_64 ve

Deltaion Lee 6 May 30, 2022
RichWatch is wrapper around AWS Cloud Watch to display beautiful logs with help of Python library Rich.

RichWatch is TUI (Textual User Interface) for AWS Cloud Watch. It formats and pretty prints Cloud Watch's logs so they are much more readable. Because

null 21 Jul 25, 2022
a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project

Aircord ??️ a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project Examp

Aircord 2 Oct 24, 2021
A wrapper for aqquiring Choice Coin directly through a Python Terminal. Leverages the TinyMan Python-SDK.

CHOICE_TinyMan_Wrapper A wrapper that allows users to acquire Choice Coin directly through their Terminal using ALGO and various Algorand Standard Ass

Choice Coin 16 Sep 24, 2022
Discord rich-presence implementation for VALORANT

not working on v1 anymore in favor of v2, but if there's any big bugs i'll try to fix them valorant-rich-presence-client Discord rich presence extensi

colinh 278 Jan 8, 2023
Unofficial Discord Rich Presence for HackTheBox platform

HTBRichPresence Unofficial Discord Rich Presence for HackTheBox platform The project is under lazy development. How to run Install requirements: // I'

Antonio 4 Apr 19, 2022