This library contains a set of functions for interacting with Solana blockchain, as well as some third-party APIs such as Jupiter, DexScreener, etc.
Project description
Ultimate-Sol Python SDK
What is this?
This library contains a set of functions for interacting with Solana blockchain, as well as some third-party APIs such as Jupiter, DexScreener, etc.
Quick Guide
Installation
To install the library, enter command:
pip install ultimate_sol
Quick start
Using the library is as simple and convenient as possible:
To interact directly with Solana blockchain, use ultimate_sol.sol.SolClient class:
from ultimate_sol.sol import SolClient
client = SolClient()
account_address = '...'
account_balance = client.get_sol_balance(account_address)
To interact with Jupiter API, use ultimate_sol.jupiter.Jupiter class:
from ultimate_sol.jupiter import Jupiter
from solders.keypair import Keypair
secret_key = '...'
keypair = Keypair.from_base58_string(secret_key)
jupiter = Jupiter(keypair)
quote = jupiter.quote(
input_mint='...',
output_mint='...',
amount=0,
...
)
Perform and send a swap
To perform a swap and send it to blockchain, use this code:
from ultimate_sol.sol import SolClient
from ultimate_sol.jupiter import Jupiter
from solders.keypair import Keypair
secret_key = '...'
keypair = Keypair.from_base58_string(secret_key)
client = SolClient()
jupiter = Jupiter(keypair)
swap = jupiter.swap(
input_mint='...',
output_mint='...',
amount=0,
...
)
tx_res = client.send_tx(swap, keypair)
Get token info
To get info about a token, such as symbol or decimals, you can use the following code:
from ultimate_sol.jupiter import get_token_info
# Returns info about token, like decimals, symbol, logo and the like (works with pump.fun tokens).
info = get_token_info('...')
Also, you can use ultimate_sol.metadata.get_metadata function. It might be faster than jupiter.get_token_info if you use a custom Solana Node.
from ultimate_sol.sol import SolClient
from ultimate_sol.metadata import get_metadata
client = SolClient()
info = get_metadata(client, '...')
Other functions
You can also use this library to interact with some other APIs, such as DexScreener or SolanaFM. Example:
from ultimate_sol.dexscreener import get_token_profile
# Returns token profile (if exist) from dexscreener with name, symbol, price, volume, etc.
token_profile = get_token_profile('...')
Developer
My GitHub: link
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ultimate_sol-0.0.3.tar.gz.
File metadata
- Download URL: ultimate_sol-0.0.3.tar.gz
- Upload date:
- Size: 8.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ff13cc5aeeaf0adc7f38bf932f483f55c36e3be0e342ffc8e68a82f4fd67ce2
|
|
| MD5 |
6676f60909bf0f560e46f31ff29f67d6
|
|
| BLAKE2b-256 |
edf08bc844cf47768491147834734e85e753b9cb5128e9c5badbace4d5c9d8bd
|
File details
Details for the file ultimate_sol-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ultimate_sol-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6c366e2390ba33604d0d37a4e97c42b1636bfe1218676072b9ad67b14de45c8
|
|
| MD5 |
c28eef0f44a564e9b0c769de40f4e4f6
|
|
| BLAKE2b-256 |
82f66b498beab96c12ec5451e949d41d73dd09cc73abedda784ede3dc359f17f
|