Questions tagged [jsonrpc-api]
The jsonrpc-api tag has no usage guidance.
58
questions
1
vote
1
answer
36
views
Multiple SPL Token Balance with one request
To get the balance of a specific token from a wallet, I use getTokenAccountsByOwner, but this is giving the balance for only one token, and I need to request for more than one token.
I was wondering ...
0
votes
1
answer
29
views
Solana validator stake history
Is there any way to get the stake history for a validator on Solana. I am trying to analyze the performance of validators on the network and am able to use the getInflationReward method ...
0
votes
1
answer
111
views
How can I get block data with all transactions with one Solana API request?
How can I get the last block or slot with all transactions in it with one Solana API request? The way I found: getSlot() -> getBlock(slotNumber). The problem with this method is that it is very ...
3
votes
1
answer
77
views
Get Balance of Sol account more then one account
Can be any API or method to get the balance of a Sol account (more than one account in one time ) not use loop like getBalance() not that function,
2
votes
1
answer
57
views
how to validate an address of solana by using dart?
i need validate solana address for integration in my project
Is there a public API for this?
2
votes
1
answer
47
views
Is it possible to identify which inner instruction is responsible for an error without relying on logs?
It is feasible using logs, using some code similar that the one found in the explorer to create log indentation. But this falls apart when log truncation kicks in. This is also not great as for ...
2
votes
1
answer
169
views
WebSocket connection failed
What is the correct URL to use for wss connection? I'm getting this error:
websocket.browser.js:47 WebSocket connection to 'wss://api.mainnet-beta.solana.com/' failed
My code used to work fine with ...
0
votes
1
answer
88
views
Why does fetching of compressed nfts by collection/owner not work?
Context: Ran the solana compressed nfts scripts successfully about 2 weeks ago from creating and minting to fetching by collection/owner using the helius devnet rpc endpoint.. This is the link to the ...
2
votes
1
answer
132
views
JSON RPC get all SPL token holders during specific time
I am trying to get all the holders of a specific SPL token during a specific time. I get the Error: {'code': -32010, 'message': 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA excluded from account ...
1
vote
0
answers
170
views
Premature close error when fetching 25 or more accounts at once with @solana/web3.js connection.getAccountInfo
Overview
Using the Connection class' method getAccountInfo with Promise.all and at least 25 requests will fail with:
Error: failed to get info about account ...
0
votes
0
answers
104
views
getTokenAccountsByDelegate not working / RPC call / Python
this is my code:
def get_harvestshares():
endpoint = "https://crimson-radial-asphalt.solana-mainnet.discover." \
"quiknode.pro/...
1
vote
1
answer
58
views
Deploy solana program on QuickNode?
I am noob!
I deployed my program on mainnet-beta but it didn't work and got 403 error. I did some research and found out that I needed to run my program on RPC server and I was referred to Quicknode.
...
2
votes
2
answers
254
views
Blockhash not found when sending transaction
I'm attempting to create a website that allows a user to send a payment for a service.
In order to send a transaction on behalf of the user, I have them sign the transaction,which is then serialized ...
2
votes
1
answer
41
views
Using getSignatureStatuses to confirm transaction
I'm using a niche language that doesn't have an existing solana library, thus needing to write my own transaction confirmation logic.
This github issue documents what the new approach for both the ts/...
0
votes
1
answer
236
views
Json Rpc Http getTransaction returns Parse Error
I want to get a transaction via json rpc http method. I make a web request for a finilazed transaction, but i get -37200 Parse error.
I use C# to make web request.
{"jsonrpc":"2.0"...
2
votes
1
answer
448
views
How to properly "wait" for a transaction to confirm?
What I have tried
I've previously used the @web3/solana npm package, but ended up having to create my own (private) library due to using a niche language.
Here is what I'm trying to do:
Serialize and ...
0
votes
1
answer
207
views
Get Epoch Information for finished epochs
My goal is to implement a function which gets epoch information of finished epochs from a node.
The input should be the epoch nr and the output should contain:
First block
First block timestamp
Last ...
0
votes
1
answer
142
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 ...
3
votes
1
answer
92
views
Calling the getSignaturesForAddress returns empty
Context: I am trying to get a history of transactions for an address. I plan to use the getSignaturesForAddress() to get all the signatures I could use to find all the confirmed transactions using the ...
2
votes
1
answer
60
views
When transaction's blockTime is null?
Documentation says, that transaction's blocktime can be null "if not available" - what are these cases when "not available"?
0
votes
1
answer
59
views
getFeeForMessage: Index out of Bounds
I have a versioned message and when I query the RPC API method getFeeForMessage it returns "invalid transaction message: index out of bounds", but I do know it is a correctly encoded message....
2
votes
1
answer
59
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 ...
1
vote
1
answer
46
views
Document for the parsed instruction data of transferChecked
I would like to know where the document for the parsed instruction data returned from RPC:getBlock with encoding=jsonParsed for Token/Token-2022 program. Or where is the "program-specific ...
2
votes
1
answer
41
views
Is getting all involved accounts of txs with state "processed" via webhook possible?
Is it possible to getting all involved accounts of a tx that has the current state "processed" via webhook?
I only managed to subscribe to the logs of new txs that are in the state "...
1
vote
1
answer
208
views
How to get last N transactions by account/address, via public API?
I have a list of addresses, thousands, and I need to monitor incoming transactions to them. Some of them are native Solana addresses, other are tokens.
How will I get the last 3-5 transactions for a ...
2
votes
2
answers
105
views
Trouble with conducting a simple transaction via Vanilla JS
My code used to work in early-mid November. It used to be a simple SOL transaction from wallet to another through a click of a button and then it just stopped working as I was dealing with something ...
1
vote
1
answer
55
views
Need help about web3.js and json rpc
Hello, I am trying to build a wallet using react native. I already completed Ethereum integration with web3 browser but I don't know how to do it with Solana?
How do solana wallets inject javascript ...
1
vote
0
answers
80
views
The getSignaturesForAddress RPC request returns "Method not found" [closed]
I am trying to perform a simple API request against the local node that seems to be working fine but the response says "Method not found" even though the validator has the --enable-cpi-and-...
1
vote
0
answers
129
views
CORS block for api.mainnet-beta.solana.com [closed]
Is there a policy for cross-origin requests to api.mainnet-beta.solana.com?
Suddenly my domain is being rejected (which ends in .finance).
What is the strict-origin-when-cross-origin policy?
The ...
2
votes
1
answer
46
views
Identifying stake and unstake transactions for a given stake account
Suppose I run a validator and am interested in historical staking and un-staking transactions with my validator. I have a list of all the stake accounts for my validator. From that I'm able to get ...
1
vote
1
answer
43
views
How to get Tokens in account by Pubkey of account owner using RPC API
I tried getTokenAccountsByOwner but that requires a mint or programId which I don't have. What if I want to figure out which tokens an account has such as NFTs using only the Pubkey of account owner?
3
votes
2
answers
78
views
Time require to restart solana validator
I am new to Solana stuff. I just create my Solana private rpc node. I have a few questions in mind if anyone could help it would be great.
1- How much time it will take if I restart the Solana ...
4
votes
0
answers
114
views
Does `jsonParsed` always work for `getTokenAccountsByOwner`?
The docs for the getTokenAccountsByOwner RPC method say:
If "jsonParsed" is requested but a parser cannot be found, the field falls back to "base64" encoding.
However since we're ...
2
votes
1
answer
339
views
Solana RPC API to view NFTs
How is it possible to view NFTs with the Solana RPC API? Have been looking at the documentation but haven't been able to figure out how to do it.
2
votes
0
answers
32
views
How to rebuild the full transaction CPIs details and depth from a single source?
The transaction meta does not allow rebuilding the exact nesting of CPIs for a given transaction, while it associates inner instructions to a given top level ix.
Is there a valid reason it is so? Is ...
5
votes
1
answer
172
views
Why are there so many missing blocks
Trying to get early (~2021 March) blocks either with public RPC, QuickNode RPC or Alchemy RPC results in almost 1/3 blocks being missing (not skipped!). Why is that so? Can those blocks be retrieved ...
1
vote
0
answers
44
views
Solana JSON RPC slower than @solana/web3.js?
Has anyone else noticed that calls to the JSON RPC for solana seem to be not as current as calls to @solana/web3.js? The method I noticed this for was getProgramAccounts. When I create a new account ...
2
votes
1
answer
133
views
How to sign a transaction with the json rpc?
I am trying to send a transaction using the JSON-RPC API. But it requires me to send a fully signed transaction
Currently, the Solana docs only mention how to sign a transaction with the solana-cli ...
1
vote
1
answer
99
views
How to correctly set the maxSupportedTransactionVersion on getTransaction() function
I am using the getTransaction() function from web3 library and if I only use the parameter signature I get a warning that this is deprecated.
And that bring what I think it is another problem derived ...
1
vote
1
answer
113
views
How to get account info from my local private rpc?
I built private rpc node in mainnet and it catches up well.
I want to get account info from localhost, but it gets error.
curl http://localhost:8899 -X POST -H "Content-Type: application/json&...
2
votes
2
answers
177
views
Solana RPC versioned transaction
The library docs say that the function
sendTransaction(transaction: Transaction, signers: Signer[], options?: SendOptions): Promise<string>
has been deprecated. Instead, one should call ...
1
vote
1
answer
74
views
Specification for Solana RPC API
Is Solana's JSON RPC API doc generated off a spec, like OpenRPC? Or is it just manually updated by core devs?
Browsing the commits, it feels like it is the latter.
1
vote
1
answer
94
views
Latency is RPC response and websocket
I have a websocket which points at my wallet, And I also have a websocket setup to get the latest event on my wallet.
I have tried sending an airdrop from CLI tool : link
The moment the transaction ...
0
votes
0
answers
29
views
Is it possible to query just Solana transactions?
Since Solana is a native token it doesn't have an associated account. So I'm failing to find a good way to query only Solana transaction (transactions that changed Solana balance)
5
votes
2
answers
188
views
How to obtain block/slot time?
How to obtain block/slot time?
I know that I can view it here under the 1min and 1hr Slot Time average, but what I'm after is a way to request it directly via the Solana-web3js library or the JSON-RPC ...
1
vote
1
answer
57
views
Why does getProgramAccounts from the JSON RPC return empty result?
Why does getProgramAccounts from the JSON RPC return empty result?
When I call getProgramAccounts from the RPC docs here:
the result returned is this:
{'jsonrpc': '2.0', 'result': [], 'id': 1}
code ...
3
votes
1
answer
80
views
Undefined owner in token balances structure even though there's an owner
When calling getParsedTransaction, in the tokenBalances here I get an undefined owner even though the token account has an owner?
Here is example
getting the transaction info for ...
1
vote
0
answers
26
views
Equivalent of eth_getLogs() in Solana?
EVM based blockchains offer eth_getLogs() RPC call and provide filters (topics argument in eth_getLogs function call) to filter out the results. Is there an equivalent in Solana RPC calls. I am using ...
2
votes
1
answer
36
views
How can I ensure that a transaction isn't repeated if my first attempt fails to get a response and I try the transaction again?
Let's say I use the JSON RPC "sendTransaction" call to perform a transaction that sends some tokens to an account, but some communication mishap happens and I get no response after ...
4
votes
1
answer
1k
views
Get Token Metadata (decimals,symbol,name...)
I'm looking to query token metadata by looking up the token address(pubkey or mint). Specifically looking for data around the name, symbol, and decimals. Is there an RPC method for this?
How does ...