Update deprecated commitments (#16794)

This commit is contained in:
Tyera Eulberg
2021-04-23 18:32:28 -06:00
committed by GitHub
parent d9dcd28d82
commit 2420b280a9
6 changed files with 7 additions and 7 deletions

View File

@ -130,7 +130,7 @@ async function fetchAccountInfo(
let data; let data;
let fetchStatus; let fetchStatus;
try { try {
const connection = new Connection(url, "single"); const connection = new Connection(url, "confirmed");
const result = (await connection.getParsedAccountInfo(pubkey)).value; const result = (await connection.getParsedAccountInfo(pubkey)).value;
let lamports, details; let lamports, details;

View File

@ -63,7 +63,7 @@ async function fetchAccountTokens(
try { try {
const { value } = await new Connection( const { value } = await new Connection(
url, url,
"recent" "processed"
).getParsedTokenAccountsByOwner(pubkey, { programId: TOKEN_PROGRAM_ID }); ).getParsedTokenAccountsByOwner(pubkey, { programId: TOKEN_PROGRAM_ID });
data = { data = {
tokens: value.map((accountInfo) => { tokens: value.map((accountInfo) => {

View File

@ -71,7 +71,7 @@ export async function fetchBlock(
let data: Block | undefined = undefined; let data: Block | undefined = undefined;
try { try {
const connection = new Connection(url, "max"); const connection = new Connection(url, "finalized");
data = { block: await connection.getConfirmedBlock(Number(key)) }; data = { block: await connection.getConfirmedBlock(Number(key)) };
status = FetchStatus.Fetched; status = FetchStatus.Fetched;
} catch (err) { } catch (err) {

View File

@ -67,7 +67,7 @@ async function fetchLargestAccounts(
try { try {
data = { data = {
largest: ( largest: (
await new Connection(url, "single").getTokenLargestAccounts(pubkey) await new Connection(url, "confirmed").getTokenLargestAccounts(pubkey)
).value, ).value,
}; };
@ -76,7 +76,7 @@ async function fetchLargestAccounts(
async (account): Promise<TokenAccountBalancePairWithOwner> => { async (account): Promise<TokenAccountBalancePairWithOwner> => {
try { try {
const accountInfo = ( const accountInfo = (
await new Connection(url, "single").getParsedAccountInfo( await new Connection(url, "confirmed").getParsedAccountInfo(
account.address account.address
) )
).value; ).value;

View File

@ -55,7 +55,7 @@ async function fetch(dispatch: Dispatch, cluster: Cluster, url: string) {
dispatch(Status.Connecting); dispatch(Status.Connecting);
try { try {
const connection = new Connection(url, "max"); const connection = new Connection(url, "finalized");
const [total, circulating, nonCirculating] = ( const [total, circulating, nonCirculating] = (
await Promise.all([ await Promise.all([

View File

@ -43,7 +43,7 @@ async function fetch(dispatch: Dispatch, cluster: Cluster, url: string) {
dispatch(Status.Connecting); dispatch(Status.Connecting);
try { try {
const connection = new Connection(url, "max"); const connection = new Connection(url, "finalized");
const supply = (await connection.getSupply()).value; const supply = (await connection.getSupply()).value;
// Update state if still connecting // Update state if still connecting