Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7961

How to get accounts from solana

$
0
0

I'm a freshman in Solana and I can't find any structured information on "how to"

So my goal is to create a wallet parser to find wallets by criteria(basically whales), I tried to use next RPC-s to use getProgramAccounts, but none of those works:

https://api.mainnet-beta.solana.com/

quicknode

I see the reason, it's restricted, but I can't find "why" this is happening and I'm frustrated because I see no possibility of using the existing endpoint and if it's the right one.

I'm writing a Python script to get an idea of how it works and currently I have this:

import base64from typing import List, Unionfrom httpx import Client as HttpxClientfrom solana.rpc.api import Clientfrom solana.rpc.types import MemcmpOptsfrom solders.pubkey import Pubkeydef main():    client = Client("")    PUBKEY = ""    MINT_ADDRESS = ""    pubkey = Pubkey.from_string(PUBKEY)    mint_address = MINT_ADDRESS    memcmp_opts = MemcmpOpts(offset=4, bytes=mint_address)    filters: List[Union[int, MemcmpOpts]] = [17, memcmp_opts]    result = client.get_account_info(pubkey)    account = result.value.default()    print(account)    # Query the program accounts    # result = client.get_program_accounts(pubkey)    #    # # Print the result (to debug and check the output)    # print(result.value)    #    # # You can also check the total number of results    # print(f"Total number of accounts found: {len(result.value)}")if __name__ == "__main__":    main()

Also, where I can find those Mints and pubkeys? Currently I'm getting them from chatgtp :DD


Viewing all articles
Browse latest Browse all 7961

Trending Articles