☄️ 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
Python CMR is an easy to use wrapper to the NASA EOSDIS Common Metadata Repository API.

This repository is a copy of jddeal/python_cmr which is no longer maintained. It has been copied here with the permission of the original author for t

NASA 9 Nov 16, 2022
TwitterDataStreaming - Twitter data streaming using APIs

Twitter_Data_Streaming Twitter data streaming using APIs Use Case 1: Streaming r

Rita Kushwaha 1 Jan 21, 2022
Template to create a telegram bot in python

Template for Telegram Bot Template to create a telegram bot in python. How to Run Set your telegram bot token as environment variable TELEGRAM_BOT_TOK

PyTopia 12 Aug 14, 2022
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
See GitHub API on terminal

gitbees About gitbees uses the GitHub API to show user data and ``repos` Using Make sure you have a python interpreter and then python gitbees.py Lice

Marcello Belanda 1 Nov 29, 2021
A telegram bot writen in python for mirroring files on the internet to Google Drive

owner of this repo :- AYUSH contact me :- AYUSH Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our bel

Thanusara Pasindu 1 Nov 21, 2021
VALORANT rank yoinker lets you retrieve the ranks and basic informations of everyone in the lobby, regardless of gamemode.

vRY VALORANT rank yoinker Retrieve the rank and basic information of everyone in the lobby, regardless of gamemode. Table of Contents Terms of Use Abo

Isaac Kenyon 270 Dec 30, 2022
Muzan-Discord-Nuker - A simple discord server nuker in python

Muzan-Discord-Nuker This is Just a simple discord server nuker in python. ✨ Feat

Afnan 3 May 14, 2022
Many discord bots serving different purposes

Discord_Botlari Farklı amaçlara hizmet eden bir çok discord botu En kapsamlı Bot Game Bottur. bir oyun botudur discord sunucularında kullanılır. (tüm

1 Dec 21, 2021
Utility for downloading fanfiction in bulk from the Archive of Our Own

What is this? This is a program intended to help you download fanfiction from the Archive of Our Own in bulk. This program is primarily intended to wo

73 Dec 30, 2022
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

1 Jan 15, 2022
BingBot - A bot that will automate searches on bing

bingBot A bot that will automate searches on bing. To install this just download

Lukas 2 Jul 28, 2022
PokemonGo-Bot - The Pokemon Go Bot, baking with community.

PokemonGo-Bot PokemonGo-Bot is a project created by the PokemonGoF team. Since no public API available for now, a patch to use HASH-Server was applied

3.8k Jan 08, 2023
Hasan Can Kaya - Konusanlar Ticket Notifier

Hasan Can Kaya - Konusanlar Ticket Notifier This script sends a notification to any telegram chat/group/channel when added a new available ticket to b

omer citak 3 Jan 31, 2022
Discord Mass Report script that uses multiple tokens

Discord-Mass-Report Discord Mass Report script that uses multiple tokens, full credits to https://github.com/hoki0/Discord-mass-report who made it in

cChimney 4 Jun 08, 2022
AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

Sougata 4 Jul 12, 2022
Quot-a-lecture - Lecture transcript question extraction

Setup virtualenv venv source venv/bin/activate pip install -r requirements.txt

Pratyaksh Sharma 5 Sep 12, 2022
Drover is a command-line utility for deploying Python packages to Lambda functions.

drover drover: a command-line utility for deploying Python packages to Lambda functions. Background This utility aims to provide a simple, repeatable,

Jeffrey Wilges 4 May 19, 2021
Python API Client for Twitter API v2

🐍 Python Client For Twitter API v2 🚀 Why Twitter Stream ? Twitter-Stream.py a python API client for Twitter API v2 now supports FilteredStream, Samp

Twitivity 31 Nov 19, 2022
Instant messaging client in tkinter

Concord_client_tk Instant messaging client in tkinter Contributors : Ilade-s [https://github.com/Ilade-s] Doku [https://github.com/D0kuhebi] Descripti

Raphaël Merlet 2 Jun 15, 2022