Skip to main content

Questions tagged [solana-py]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
27 views

set_compute_unit_limit requires an unknown signer [duplicate]

ix = process_item( {"lamports": int(lamports)}, { "destination": destination_pk, "from_account": from_account, "...
ZeroNine's user avatar
  • 496
2 votes
1 answer
250 views

How to obtain the top 5 holders of a Solana token using getProgramAccounts?

I've been trying to use the getProgramAccounts method in the Solana Python API to get the top 5 holders of a specific token. My code looks like this: from solana.rpc.types import MemcmpOpts from ...
Nerevaine's user avatar
  • 169
0 votes
1 answer
48 views

Error: solders.SignerError: not enough signers

I am trying to buy a token through solana.ру, but in the process of writing the code, I get an error from solana.rpc.api import Client, Keypair, Pubkey from spl.token.constants import TOKEN_PROGRAM_ID ...
AREW's user avatar
  • 33
1 vote
1 answer
169 views

How to completely move balance out of Sol Wallet

(Not token) I'm trying to move all the SOL that I receive in my SOL wallet, but I get an error: Transaction results in an account (0) with insufficient funds for rent While I know what rent is, and ...
soeth's user avatar
  • 11
1 vote
1 answer
229 views

Should I use Versioned Transactions instead of Legacy?

Trading on Raydium, I use Legacy transactions, but when I look at Solscan, other traders use Versioned Transactions (here's an example of such a transaction https://solscan.io/tx/...
xallve's user avatar
  • 17
0 votes
1 answer
324 views

How can I send multiple transactions simultaneously in Python?

I am currently in a situation where I need to send multiple transactions simultaneously. I see that it is possible as some accounts can send 10 or even more transactions per second, and their ...
xallve's user avatar
  • 17
0 votes
3 answers
3k views

Why does my transaction takes ages to be sent

I am trying to make a swap transaction on Raydium using Python. I always preparing the transaction and necessary instructions for the swap in advance: print("Add Instructions To Transaction...&...
xallve's user avatar
  • 17
1 vote
1 answer
1k views

Raydium Swap -- Program log: Error: The amm account owner is not match with this program

Getting this error when attempting a swap on Raydium within the first few seconds of a pool being created. "Program log: Error: The amm account owner is not match with this program "Program ...
Fakebl0ck's user avatar
1 vote
1 answer
295 views

Not enough signers when setting compute units

Getting this error when trying to set priority fee solders.SignerError: not enough signers Python 3.10.2 Solders 0.18.1 Solana 0.30.2 Code example is just following the solana cookbook: ... ...
Fakebl0ck's user avatar
0 votes
0 answers
56 views

How to add metadata to my SPL token on python

I am new to solana programming using solana.py python sdk, I have successfully minted tokens to an account but don't know how to add metadata to the token. Please is there a way to do this?
Dave's user avatar
  • 1
1 vote
1 answer
2k views

Simulating a buy/sell transaction

I just need some direction in figuring out how to simulate a buy/sell transaction of an spl token. example token: G33s1LiUADEBLzN5jL6ocSXqrT2wsUq9W6nZ8o4k1b4L i've messed around with solana-py/solders ...
user9116's user avatar
0 votes
1 answer
74 views

"Encountering ValueError: *signers args are not used when sending VersionedTransaction in Solana Python Library"

I'm currently working on integrating Solana functionality into my Python application using the Solana Python library. During the process of sending a transaction, I encountered a ValueError with the ...
Cosinus basic function's user avatar
1 vote
0 answers
54 views

Getting all "Anchor Data" variables using solana-py

I'm using solana-py to get account info from Token Acccounts on Solana, however the returned data doesn't include the full "Anchor Data" I'm seeing on solana.explorer from solana.rpc.api ...
thomas.mac's user avatar
1 vote
1 answer
150 views

Simple transfer in Python: 'not enough signers'

and apologies if there's a obvious better place to ask this. I'm writing experimental Python 3.12 code to move SOL from/to an address I create "by hand" and a centralized exchange (Kraken), ...
Richard Hickling's user avatar
1 vote
1 answer
2k views

How to Programmatically Buy SPL Solana Tokens Using Python and the Solana SDK?

I am exploring ways to automate the process of buying SPL Solana tokens using Python and the Solana SDK. I have been working with the Solana blockchain and understand the basics of creating wallets, ...
Cosinus basic function's user avatar
0 votes
1 answer
155 views

Solana py - Websocket Subscription to GetTokenAccountBalance

Based on my research, I came to know that encoding = "base64" would solve the error "solders.SerdeJSONError: a list or single element". But when we try to subscribe to ...
Praveen's user avatar
0 votes
2 answers
1k views

How to fetch Solana Token Metadata as .JSON Response using Python

I'm trying to create a program in python that takes the address of a Solana token and returns its metadata as a .JSON response. I know how to do it for ETH using the alchemy-sdk, when I found out the ...
Ollenmire's user avatar
0 votes
1 answer
291 views

How to getProgramAccounts for Token 2022 Program?

I am trying to send get request as follows but it returns nothing... Can you please guide me how to fix this issue? and how to figure out the datasize and bytes for any program address... { jsonrpc:&...
kokiez's user avatar
  • 123
2 votes
3 answers
1k views

How to convert Keypair.secret_key to Phantom compatible private key in python?

CODE keypair = Keypair.generate() key = keypair.secret_key This secret key isn't compatible in phantom wallet. I figured that the phantom private key can be converted to Keypair compatible secret key ...
aste123's user avatar
  • 171
3 votes
2 answers
1k views

How to use custom priority fee when sending solana transactions using solana.py

This is my current code. CODE: from solana.rpc.api import Client from solana.keypair import Keypair from solana.transaction import Transaction from solana.system_program import TransferParams, ...
aste123's user avatar
  • 171
1 vote
0 answers
72 views

Invalid request on client.request_airdrop()

CODE: from solana.rpc.api import Client from solana.keypair import Keypair LAMPORT_PER_SOL = 1000000000 client = Client("https://rpc.ankr.com/solana_devnet") wallet = Keypair.generate() ...
aste123's user avatar
  • 171
1 vote
0 answers
986 views

Trying to get started with solana-py

I hope this is ok to ask here. I've been attempting to get my feet web in web3 dev stuff for awhile now. It's had fits and starts for months now. We had baby 3 a few months ago, but I'm back in the ...
TradeUpCards's user avatar
1 vote
1 answer
817 views

Staking in python?

I'm currently trying to use this branch of Solana-py to create a script which allows me to automatically find the best validator and stake my SOL with it. I'm having an issue when trying to pass the ...
Morgandril's user avatar
4 votes
1 answer
1k views

Monitoring transactions for Solana in real time for an address

So I wonna monitor an address or more to print in my terminal each time there's a transaction... I used the solana-py library method signatures = client.get_signature_for_address(address, limit=1)....
thewise's user avatar
  • 49
0 votes
1 answer
702 views

"Invalid param: could not find account" when using solana.py to call solana RPC API function

I need some help with solana.py API (for python). I am trying to get total supply of the token (token here) - so I copy mint address according to documentation (gettokensupply) and write usual code on ...
EndOfTheGlory's user avatar
2 votes
1 answer
823 views

finding all token addresses in a wallet

im using python and the RPC API, which based on my research only has the GPA (get program accounts) in terms of getting a list of owned tokens. how can i do this without using GPA due to its various ...
Morgandril's user avatar
1 vote
0 answers
274 views

solana-py simulate transaction without signatures

i am using the solana-py lib and tried to simulate a given transaction that is not signed. Although the simulate_transaction() call has the argument sig_verify with the default being False already, i ...
leanm's user avatar
  • 76
5 votes
3 answers
878 views

Creating account randomly fails (AccountNotFound)

In my Python code I am creating a new account on the devnet using the solana module's create_account instruction. Simulation of the transaction sometimes fails with the "AccountNotFound" ...
mcshell's user avatar
  • 205
5 votes
2 answers
7k views

"Invalid account data for instruction" when trying to transfer USDC tokens

I want to transfer tokens from one account to another using Solana-py library. Here's what I have now: sender_address = '7FdZ8Rv5QZ8zLzGhDpyGYB95uXEK5BaxpKKCjqmBZJnL' sender_secret_key = '...' ...
Mortasen's user avatar
1 vote
0 answers
55 views

How to use Magic Eden instruction endpoints and turn them into transactions in solana-py

I want to start interacting with Magic Eden NFTs through my solana-py code. So I want to learn how to use the endpoints at https://api.magiceden.dev/#82874536-9430-4dae-81dc-1235baaa3ef3. I have an ...
Pixeled's user avatar
  • 476
2 votes
4 answers
2k views

how to get owner of token account

I'm using solana-py and trying to get the owner of an associated token account. I have gotten the associated account address like this: from solana.publickey import PublicKey from solana.rpc.api ...
Maxisy's user avatar
  • 43
1 vote
2 answers
944 views

Magic Eden API instructions/buy_now

I'm trying to use Magic Eden API and solana-py to buy an NFT for the listed price. I'm using the instructins/buy_now endpoint to do that. I get an error when trying to buy the NFT. Have been trying to ...
Maxisy's user avatar
  • 43
0 votes
1 answer
495 views

How do I create transaction instructions? [closed]

I’m learning how to send transactions through solana-py. I have everything down except for instructions. How do I calculate them?
Pixeled's user avatar
  • 476