Update deprecated commitments (#16794)
This commit is contained in:
parent
d9dcd28d82
commit
2420b280a9
|
@ -130,7 +130,7 @@ async function fetchAccountInfo(
|
|||
let data;
|
||||
let fetchStatus;
|
||||
try {
|
||||
const connection = new Connection(url, "single");
|
||||
const connection = new Connection(url, "confirmed");
|
||||
const result = (await connection.getParsedAccountInfo(pubkey)).value;
|
||||
|
||||
let lamports, details;
|
||||
|
|
|
@ -63,7 +63,7 @@ async function fetchAccountTokens(
|
|||
try {
|
||||
const { value } = await new Connection(
|
||||
url,
|
||||
"recent"
|
||||
"processed"
|
||||
).getParsedTokenAccountsByOwner(pubkey, { programId: TOKEN_PROGRAM_ID });
|
||||
data = {
|
||||
tokens: value.map((accountInfo) => {
|
||||
|
|
|
@ -71,7 +71,7 @@ export async function fetchBlock(
|
|||
let data: Block | undefined = undefined;
|
||||
|
||||
try {
|
||||
const connection = new Connection(url, "max");
|
||||
const connection = new Connection(url, "finalized");
|
||||
data = { block: await connection.getConfirmedBlock(Number(key)) };
|
||||
status = FetchStatus.Fetched;
|
||||
} catch (err) {
|
||||
|
|
|
@ -67,7 +67,7 @@ async function fetchLargestAccounts(
|
|||
try {
|
||||
data = {
|
||||
largest: (
|
||||
await new Connection(url, "single").getTokenLargestAccounts(pubkey)
|
||||
await new Connection(url, "confirmed").getTokenLargestAccounts(pubkey)
|
||||
).value,
|
||||
};
|
||||
|
||||
|
@ -76,7 +76,7 @@ async function fetchLargestAccounts(
|
|||
async (account): Promise<TokenAccountBalancePairWithOwner> => {
|
||||
try {
|
||||
const accountInfo = (
|
||||
await new Connection(url, "single").getParsedAccountInfo(
|
||||
await new Connection(url, "confirmed").getParsedAccountInfo(
|
||||
account.address
|
||||
)
|
||||
).value;
|
||||
|
|
|
@ -55,7 +55,7 @@ async function fetch(dispatch: Dispatch, cluster: Cluster, url: string) {
|
|||
dispatch(Status.Connecting);
|
||||
|
||||
try {
|
||||
const connection = new Connection(url, "max");
|
||||
const connection = new Connection(url, "finalized");
|
||||
|
||||
const [total, circulating, nonCirculating] = (
|
||||
await Promise.all([
|
||||
|
|
|
@ -43,7 +43,7 @@ async function fetch(dispatch: Dispatch, cluster: Cluster, url: string) {
|
|||
dispatch(Status.Connecting);
|
||||
|
||||
try {
|
||||
const connection = new Connection(url, "max");
|
||||
const connection = new Connection(url, "finalized");
|
||||
const supply = (await connection.getSupply()).value;
|
||||
|
||||
// Update state if still connecting
|
||||
|
|
Loading…
Reference in New Issue