☄️ 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
Astro Bot With Golang

Astro-Bot Features: Astronomy Picture of the day Horoscope People In Space How we built it Our team was broken, one person didn't do anything the othe

Vaarun Sinha 1 Nov 21, 2021
This is a Telegram video compress bot repo. By Binary Tech💫

This is a Telegram Video Compress Bot. Prouduct By Binary Tech 💫 Features Compresse videos and generate screenshots too.You can set custom video name

silentz lk 2 Jan 06, 2022
Official implementation of DeepSportLab (a fork of OpenPifPaf)

DeepSportLab DeepSportLab: a Unified Framework for BallDetection, Player Instance Segmentationand Pose Estimation in Team Sports Scenes This paper pre

ISPGroupUCL 8 Sep 27, 2022
A simple Telegram bot that can add caption to any media on your channel

Channel Auto Caption This bot can add a caption for any media/document sent to a channel. Just deploy bot and add bot as admin to a channel. Deploy to

22 Nov 14, 2022
Battle Pass farming tft bot

Tft bot Bot para farmar pontos do Passe de Batalha do TFT Descrição A cada partida de tft jogada você ganha 100 pontos no passe, porém você não precis

Leonardo Gonçalves 4 Jan 27, 2022
QuickStart specific rules for cfn-python-lint

AWS Quick Start cfn-lint rules This repo provides CloudFormation linting rules specific to AWS Quick Start guidelines, for more information see the Co

AWS Quick Start 12 Jul 30, 2022
Parse discord tokens from any file, even if there is other shit in the file with them.

Discord-Token-Parser Parse discord tokens from any file, even if there is other shit in the file with them. Any. File. I glued together all html from

4 May 07, 2022
Neko is An Anime themed advance Telegram group management bot.

NekoRobot A modular telegram Python bot running on python3 with an sqlalchemy, mongodb database. ╒═══「 Status 」 Maintained Support Group Included Free

Lovely Prince 11 Oct 11, 2022
CDBEC: Catware DataBase Encryption Client

CDBEC: Catware DataBase Encryption Client Описание CDBEC - клиент для создания, просмотра и редактирования .db-catencrypted списков, шифруемых при пом

Catware-Foundation 2 Nov 03, 2022
Ridogram is an advanced multi-featured Telegram UserBot.

Ridogram Ridogram is an advanced multi-featured Telegram UserBot. String Session Collect String Session by running python3 stringsession.py locally or

Md. Ridwanul Islam Muntakim 134 Dec 29, 2022
Light weight Scripts and Apps for checking availability of Covid Vaccines in India. Notifies when vaccine becomes avialable in your area.

vaccine-checker Light weight Scripts and Apps for checking availability of Covid Vaccines in India. Notifies when vaccine becomes avialable in your ar

Abishek V Ashok 8 Jun 16, 2021
Twitch Points Miner for multiple accounts with Discord logging

Twitch Points Miner for multiple accounts with Discord logging Creator of the Twitch Miner -- PLEASE NOTE THIS IS PROBABLY BANNABLE -- Made on python

8 Apr 27, 2022
A liblary whre you can find helpful functions for your discord bot

DBotUtils A liblary whre you can find helpful functions for your discord bot Easy setup Setup is easily and flexible. Change anytime. After setup just

Kondek286 1 Nov 02, 2021
DeFi wallet on Chia Network.

DeFi wallet on Chia Network.

GobyWallet 21 Aug 12, 2022
Repositório para meu Discord Bot pessoal

BassetinhoBot Escrevi o código usando o Python 3.8.3 e até agora não tive problemas rodando nas versões mais recentes. Repositório para o Discord Bot

Vinícius Bassete 1 Jan 04, 2022
Minecraft checker

This Project checks if a minecraft account is a nfa/sfa account or invalid it also says you if the ip you are using is shadow banned from minecraft (shadow bann is if you send too many login attempts

baum1810 4 Oct 03, 2022
Telegram Voice-Chat Bot

Telegram Voice-Chat Bot [PyTGCalls] ⇝ Requirements ⇜ Account requirements A Telegram account to use as the music bot, You cannot use regular bot accou

1 Dec 03, 2021
Want to play What Would Rather on your Server? Invite the bot now! 😏

What is this Bot? 👀 What You Would Rather? is a Guessing game where you guess one thing. Long Description short Take this example: You typed r!rather

FSP Gang s' YT 3 Oct 18, 2021
Telegram Group Chat Statistics With Python

Telegram Group Chat Statistics How to Run First add PYTHONPATH in repository root directory enviroment variable by running: export PYTHONPATH=${PWD}

Sina Nazem 3 Apr 18, 2022
Python Client for Yandex Cloud Logging

Python Client for Yandex Cloud Logging Installation pip3 install python-yandex-cloud-logging Creating a Yandex Cloud Logging Group yc logging group c

MCode 0 Dec 08, 2021