Update deprecated commitments (#16794)
This commit is contained in:
@ -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;
|
||||||
|
@ -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) => {
|
||||||
|
@ -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) {
|
||||||
|
@ -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;
|
||||||
|
@ -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([
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user