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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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) => {

View File

@ -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) {

View File

@ -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;

View File

@ -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([

View File

@ -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