☄️ 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 discord self-bot to automate shitposting for your everyday needs.

Shitpost Selfbot A discord self-bot to automate shitposting for your everyday needs. Caution: May be a little racist. I have no clue where we are taki

stormy 1 Mar 31, 2022
Wechat-file-cleaner - Clean files in PC WeChat FileStorage directory

Wechat-file-cleaner - Clean files in PC WeChat FileStorage directory

Xingjian Zhang 1 Feb 06, 2022
Tinkoff social pulse api wrapper

Tinkoff social pulse api wrapper

Semenov Artur 9 Dec 20, 2022
To dynamically change the split direction in I3/Sway so as to split new windows automatically based on the width and height of the focused window

To dynamically change the split direction in I3/Sway so as to split new windows automatically based on the width and height of the focused window Insp

Ritin George 6 Mar 11, 2022
Auto Join: A GitHub action script to automatically invite everyone to the organization who comment at the issue page.

Auto Invite To Org By Issue Comment A GitHub action script to automatically invite everyone to the organization who comment at the issue page. What is

Max Base 6 Jun 08, 2022
This library is for simplified work with the sms-man.com API

SMSMAN Public API Python This is a lightweight library that works as a connector to Sms-Man public API Installation pip install smsman Documentation h

13 Nov 19, 2022
A telegram bot to monitor the latest NFT price on BSC.

NFT_Monitor This is a telegram bot for monitoring price and ranking of NFT on Binance Smart Chain. Can fetch latest ranking and price in real time. .P

Niko Pang 10 Oct 09, 2022
Visualize size of directories, s3 buckets.

Dir Sizer This is a work in progress, right now consider this an Alpha or Proof of Concept level. dir_sizer is a utility to visualize the size of a di

Scott Seligman 13 Dec 08, 2022
Python library for Seeedstudio Grove devices

grove.py Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms: Coral Dev Board (Wiki) NVIDIA Jet

Seeed Studio 123 Dec 17, 2022
Cool Discord bot for you

BountyBot Баунти – современный бот созданный с целью сделать ваш сервер лучше! В кратце В нем присутствует множество основных и интересных функций, та

Leestarb Original 1 Nov 22, 2021
Cogs for RedDiscord-Bot V3

Cogs v3 Disclaimer: This is an unapproved repo, meaning no one has formally reviewed this repo yet and any loss of data in your bot isn't my fault (An

Honkertonken 5 Nov 17, 2022
Hello i am TELEGRAM GROUP MANAGEMENT BOT MY NAME IS Evil-Inside ⚡ i have both amazing modules

Evil-Inside DEMO BOT - Evil-Inside Hello i am TELEGRAM GROUP MANAGEMENT BOT MY NAME IS Evil-Inside ⚡ i have both amazing modules ℂ𝕆ℕ𝕋𝔸ℂ𝕋 𝕄𝔼 𝕆ℕ

PANDITHAN 52 Nov 20, 2022
Unofficial Meteor Client wiki

Welcome to the Unofficial Meteor Client wiki! Meteor FAQs | A rewritten and better FAQ page. Installation Guide | A guide on how to install Meteor Cli

Anti Cope 0 Feb 21, 2022
Busty - A bot for the Busty Discord server

Busty Discord bot used for the Busty server. Install You'll need at least Python

Andrew Morgan 7 Dec 05, 2022
SMAM2 is a package manager built specifically for SourceMod.

SourceMod Addon Manager 2 (SMAM2) SMAM2 is a package manager built specifically for SourceMod. This was heavily inspired by Phil25's SMAM. I thought t

John Mascagni 6 Sep 16, 2022
Simple Telegram webscrap bot

webscrap-bot Simple Telegram webscrap bot Configs TOKEN - Get bot token from @BotFather API_ID - From my.telegram.org API_HASH - From my.telegram.org

lokaman chendekar 10 Oct 21, 2022
Python On WhatsApp - Run your python codes on whatsapp along with talking to a chatbot

Python On WhatsApp Run your python codes on whatsapp along with talking to a chatbot This is a small python project to run python on whatsapp. and i c

Prajjwal Pathak 32 Dec 30, 2022
Make your Pass (sanitaire) Fun Again

Make Your Pass (Sanitaire) Fun Again Customize your Pass Sanitaire (French name for EU digital Covide19 Certificate) with colors and images, thus make

101 Dec 01, 2022
The official Pushy SDK for Python apps.

pushy-python The official Pushy SDK for Python apps. Pushy is the most reliable push notification gateway, perfect for real-time, mission-critical app

Pushy 1 Dec 21, 2021
Ciclo 1 - MisiónTIC - UIS (Retos)

misiontic_uis Ciclo 1 - MisiónTIC - UIS Reto 1: Fundamentos del Lenguaje Python Reto 2: Estructuras de Control Condicional Reto 3: Estructuras de Cont

9 May 24, 2022