Questions tagged [solana-py]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
55 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
0 votes
1 answer
38 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
19 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
141 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
0 answers
11 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
23 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
53 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
224 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
0 answers
49 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
0 answers
279 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
119 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
  • 105
1 vote
2 answers
247 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
  • 141
1 vote
1 answer
319 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
  • 141
1 vote
0 answers
31 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
  • 141
1 vote
0 answers
565 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
724 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
342 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
277 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
169 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
174 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
340 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
3k 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
38 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
  • 441
1 vote
2 answers
712 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
  • 33
1 vote
2 answers
714 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
  • 33
0 votes
1 answer
213 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
  • 441