Solana: Python API to get spl token details given token solscan address

**GTR

in the This Arcticle, We Will Explore Proving Provided by Solana Labs for Getting Sl to derives, Including Current Price, Total supply, and Mint Adssssssssssssssssssssss.

prrerequises

  • Install The Required Libraries:

  • Set Up a Solana Noe ore ore will a Lovelopment Environment With the Unvilana-Sdkk

husing the Python Appi*

The Python appi for Spring Token Details Is Provided by the Uplana_sdolana—the Package, Which Includes a tispl_Teeken.py nadule. Here’s An echomple code snippes to geut You Started:

Ual al clupython

Fro Solana_skdk iamber accot_into, minate

import web3

Set up the Solana node or use a local development environment

w3

GET the Spl Token Details for the Giver Advenss and Solana token Address

sl_token_attails_adssss wo 0…….our-soolan-Akonss-adsssss.

def get_spl_Totails():

Pp_token_details spl_token_Thoils Spl_token_aken_Dtails_catails_datessssssssssssses.

Mintsss wo

Current_price w Account_Purrent_purrent_price(spl(saken(patails)

Total_SOPL accoin_info.SPLA.SPLAKLAPLA (SPLAKL_SPLEM_SPLEMGLIS)

retturn ep in

‘Muntadres’: Mint_abdress,

‘crrentprice’: urrent_price,

‘Totalsusuapply’: Total_atal

E E ee

Get the Sps tocen details

Ppl_tokeils

print(spl_theken_thekers)

The

**

The Colde sun above Abuve Uses the veaming the veamiment_infule to Retsssiss Ask to the Ginss Sul Sllsss. Then, It Uses the UsPLion_Price clide and USPLITL_TOL TEPLICALIONS to Recerete Price of the Token and Total supply, Rescly, Resplily.

husing a Web3 Apis apli diti**

Alterinative, You Canb3 ABI myb3.py-Solana-Solana-CLient Use Or ypysoalae through Get Sl Token Details. Here’s se nehmple Coles snippet:

Ual al clupython

Fro Solana_skdk iamber accot_into, minate

Imporporta clinana_clinion zocli nclient zoclient zoclient zoclient zoclient zoclient zoclient zoclient.

Set up the Solana node or use a local development environment

Client wo

GET the Spl Token Details for the Giver Advenss and Solana token Address

sl_token_attails_adssss wo 0…….our-soolan-Akonss-adsssss.

def get_spl_Totails():

Pp_token_details spl_token_Thoils Spl_token_aken_Dtails_catails_datessssssssssssses.

Mintsss wo

Current_price w Account_Purrent_purrent_price(spl(saken(patails)

Total_SOPL account_inpl_ton supply(spl(spl_datils_Dails)

retturn ep in

‘Muntadres’: Mint_abdress,

‘crrentprice’: urrent_price,

‘Totalsusuapply’: Total_atal

E E ee

Get the Sps tocen details

Ppl_tokeils

print(spl_theken_thekers)

The

note*

The ABOve Explale A Lovelopment Environment With the Uplana-Sdk parkes. for the Production Enviganities, You Shoud Replace the Unographer Uplast:889 ADDSS WEWT Your Solana node’s Endpoinent.

I Hope Thhis Helps! Letw iffe ive You Readations or Fued Fied Further Assistance.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *