Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ultimate_sol-0.0.2.tar.gz (8.3 MB view details)

Uploaded Source

Built Distribution

ultimate_sol-0.0.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file ultimate_sol-0.0.2.tar.gz.

File metadata

  • Download URL: ultimate_sol-0.0.2.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

Hashes for ultimate_sol-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9b6c8d2daf9f518e0478d16fd368973c7720fd9bdf4deb50e64375f86f385c87
MD5 dd46d16e87bf09ce3a9d5474122465c2
BLAKE2b-256 51e4c2fa8d11d1cd5f6a01c74fbbd1f32eeaf0ad9b06f66c81cefbb72449c6b1

See more details on using hashes here.

File details

Details for the file ultimate_sol-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ultimate_sol-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 39acc597774e25cc544332825d34d53a52d906d81c7ad44b2d7f0ffc14dbf923
MD5 b5f09a232fd7eb0cf82eaa5412976c5a
BLAKE2b-256 cddf7678d381cee6e95b80e142cb20ffd08126dfe38b8c7114e004c5e5cd700b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page