Comments (7)
Can you give a reproducible example please?
from anchorpy.
This was the main code. I am just trying to load the accounts from the main program and nothing more. I don't know what do you want exactly
from anchorpy.
I'm looking for a minimal reproducible example please https://stackoverflow.com/help/minimal-reproducible-example
from anchorpy.
Ok got it,
consider I have submitted multiple accounts using my wallet into the program. I have a program that makes the accounts containing three variables, var1, var2, and var3 (except the authority).
The web interface makes multiple instances of that account:
ac1: var1, var2, var3
ac2: var1, var2, var3
now the network contains the ac1 and ac2, meaning that the program has two accounts.
Now I have the publickey
pubkey = PublicKey("...")
of the program and I want to load and decode those variables(the three variables belong to ac1 and ac2) into my python program.
The client is connected to the program using publickey and tries to load the ac1 and ac2:
accounts = []
for x in http_client.get_program_accounts_json_parsed(pubkey).value:
accounts.append(x.account)
from anchorpy.
This isn't reproducible since I don't know the pubkey you're using
from anchorpy.
The pubkey is a generated key, if this is the problem and having the key solves the problem, here it is:
E1g4fAGA38Q7yD2SuMZeemsm8T879jtqzrtch8ffMFHA
so the code:
pubkey = PublicKey("E1g4fAGA38Q7yD2SuMZeemsm8T879jtqzrtch8ffMFHA")
from anchorpy.
This runs fine on my machine with the latest solana-py and solders, though it prints an empty list (idk if that's what you expect):
from solana.rpc.api import Client
from solders.pubkey import Pubkey
http_client = Client("https://api.devnet.solana.com")
pubkey = Pubkey.from_string("E1g4fAGA38Q7yD2SuMZeemsm8T879jtqzrtch8ffMFHA")
accounts = []
for x in http_client.get_program_accounts_json_parsed(pubkey).value:
accounts.append(x.account)
print(accounts)
If you update to the latest versions do you get the same behaviour?
Also this issue should be in the solana-py or solders repo, not here
from anchorpy.
Related Issues (20)
- Unable to run tests
- Add compatibility with Solana v0.28.1
- TypeError: object solders.rpc.responses.GetAccountInfoResp can't be used in 'await' expression HOT 1
- TypeError: get_account_info() missing 1 required positional argument: 'pubkey' HOT 1
- Unknown variant `hashMap` HOT 2
- Optional dependencies HOT 1
- Client generation error HOT 4
- Version Release HOT 1
- Issue with dependency HOT 4
- Black fails parsing IDL
- `anchorpy client-gen` fails with error: "unknown variant `alias`, expected `struct` or `enum`" HOT 2
- invalid transaction: Transaction failed to sanitize accounts offsets correctly HOT 1
- Installing zstandard (0.18.0): Failed HOT 2
- ModuleNotFoundError: No module named 'pytest_xprocess' HOT 3
- anchorpy parser problem
- Error while decoding to utf-8 HOT 8
- Pipenv dependency error HOT 2
- Support additional keys under "metadata"
- Borsh extension ImportError HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anchorpy.