☄️ 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
Implementation of the paper 'Sentence Bottleneck Autoencoders from Transformer Language Models'

Introduction This repository contains the code for the paper Sentence Bottleneck Autoencoders from Transformer Language Models by Ivan Montero, Nikola

Ivan Montero 14 Dec 28, 2022
Free TradingView webhook alert for basic plan users.

TradingView-Free-Webhook-Alerts Project start on 01-02-2022 Providing the free webhook service to the basic plan users in TradingView. Portal ↠ Instal

Freeman 31 Dec 25, 2022
The worst but simplest webhook bot for GitHub and Matrix.

gh-bot gh-bot is maybe the worst (but simplest) Matrix webhook bot for Github. Example of commits: Example of workflow finished: Setting up Server You

Jae Lo Presti 4 Aug 18, 2022
Disqus API bindings for Python

disqus-python Let's start with installing the API: pip install disqus-python Use the API by instantiating it, and then calling the method through dott

DISQUS 163 Oct 14, 2022
Info & tools for reverse engineering the M6 smart fitness band

m6-reveng This repo contains information and tools for reverse engineering the $7 M6 smart fitness band. Hardware The SoC (system-on-a-chip) is a Teli

41 Dec 26, 2022
Send automated wishes to your contacts at scheduled time through WhatsApp. Written for Raspberry pi.

Whatsapp Automated Wishes Helps to send automated wishes to your contacts in Whatsapp at scheduled time using pywhatkit . Written for Raspberry pi. Wi

Uthayamurthy 2 Dec 13, 2022
PYAW allows you to call assembly from python

PYAW allows you to call assembly from python

2 Dec 13, 2021
This is a repository for the Duke University Cloud Computing course project on Serveless Data Engineering Pipeline. For this project, I recreated the below pipeline.

AWS Data Engineering Pipeline This is a repository for the Duke University Cloud Computing course project on Serverless Data Engineering Pipeline. For

15 Jul 28, 2021
CDBEC: Catware DataBase Encryption Client

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

Catware-Foundation 2 Nov 03, 2022
Termux Pkg

PKG Install Termux All Basic Pkg. Installation : pkg update && pkg upgrade && pkg install python && pkg install python2 && pkg install git && git clon

ɴᴏʙɪᴛᴀシ︎ 1 Oct 28, 2021
A BOT TO FIND ID OF A STICKER.

sticker id A BOT TO FIND ID OF A STICKER. THIS REPOSITORY HAVE TWO BRANCHES FOR DEPLOY WITH COMMAND & WITHOUT COMMAND. Mandatory variables API_ID - Ge

Ashik Muhammed 3 Dec 29, 2022
Stackoverflow Telegram Bot With 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 10 Mar 07, 2022
A Telegram bot written in python.

telegram_bot This bot is currently a beta project. Features A telegram bot which can: Send current COVID-19 cases/stats of Germany Send current worth

HuhnCares 1 Jan 11, 2022
A Discord bot to play bluffing games like Dobbins or Bobbins

Usage: pip install -r requirements.txt python3 bot.py DISCORD_BOT_TOKEN Gameplay: All commands are case-insensitive, with trailing punctuation and spa

4 May 27, 2022
Telegram client written in GTK & Python

Meowgram GTK Telegram Client 🐱 Why Meogram? Meowgram = Meow + Gram :D Meow - Talking cats sound. It's a symbol of unique and user friendly UI of clie

Artem Prokop 71 May 04, 2022
Self-adjusting, auto-compounding multi-pair DCA crypto trading bot using Python, AWS Lambda & 3Commas API

Self-adjusting, auto-compounding multi-pair DCA crypto trading bot using Python, AWS Lambda & 3Commas API The following code describes how we can leve

Jozef Jaroščiak 21 Dec 07, 2022
Script to post multiple status(posts) on twitter

Script to post multiple status on twitter (i.e. TWITTER STORM) This program can post upto maximum limit of twitter(around 300 tweets) within seconds.

Sandeep Kumar 4 Sep 09, 2021
A qq bot based on nonebot2 and go-cqhttp

Asoul-bot A qq bot based on nonebot and go-cqhttp 你可以将bot部署在本地,也可以加入bot测试群:784280070(全体禁言) 你可以通过临时会话的方式向bot发送指令,输入help获取帮助菜单 本地部署请参考:https://zhuanlan.

11 Sep 23, 2022
Trading Strategies (~50%) developed by GreenT on QuantConnect platform over the autumn quarter

Trading Strategies ~50% of codes from the Applied Financial Technology Course. Contributors: Claire W. Derrick T. Frank L. Utkarsh T. Course Leads: Dy

Utkarsh 2 Feb 07, 2022
A telegram smoot and high quality music player bot.

▪︎ Music Player ▪︎ A smooth telegram music bot with high quality songs ■ [Features] • Fast Starts streaming your inputs while downloading and converti

Simple Boy 3 Feb 05, 2022