getMultipleAccounts
All the specifications for getMultipleAccounts RPC Method on Solana
Parameters required for this RPC call
curl https://rpc.shyft.to?api_key=YOUR-API-KEY -s -X \
POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getMultipleAccounts",
"params": [
[
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
"4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"
],
{
"encoding": "base58",
"commitment": "finalized"
}
]
}
'import {
Connection,
PublicKey,
clusterApiUrl,
type GetMultipleAccountsConfig,
} from "@solana/web3.js";
const connection = new Connection("https://rpc.shyft.to?api_key=YOUR-API-KEY", "confirmed");
let addresses = [
new PublicKey("vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"),
new PublicKey("4fYNw3dojWmQ4dXtSGE9epjRGy9pFSx62YypT7avPYvA"),
];
let config: GetMultipleAccountsConfig = {
commitment: "finalized",
};
let accounts = await connection.getMultipleAccountsInfo(addresses, config);
console.log(accounts);Last updated