Remove cached transactions from explorer and update copy (#11965)
This commit is contained in:
parent
7641b60a2b
commit
2de7768f41
|
@ -22,7 +22,6 @@ import { LoadingCard } from "components/common/LoadingCard";
|
||||||
import { TableCardBody } from "components/common/TableCardBody";
|
import { TableCardBody } from "components/common/TableCardBody";
|
||||||
import { displayTimestamp } from "utils/date";
|
import { displayTimestamp } from "utils/date";
|
||||||
import { InfoTooltip } from "components/common/InfoTooltip";
|
import { InfoTooltip } from "components/common/InfoTooltip";
|
||||||
import { isCached } from "providers/transactions/cached";
|
|
||||||
import { Address } from "components/common/Address";
|
import { Address } from "components/common/Address";
|
||||||
import { Signature } from "components/common/Signature";
|
import { Signature } from "components/common/Signature";
|
||||||
import { intoTransactionInstruction } from "utils/tx";
|
import { intoTransactionInstruction } from "utils/tx";
|
||||||
|
@ -281,7 +280,6 @@ function AccountsCard({
|
||||||
signature,
|
signature,
|
||||||
autoRefresh,
|
autoRefresh,
|
||||||
}: SignatureProps & AutoRefreshProps) {
|
}: SignatureProps & AutoRefreshProps) {
|
||||||
const { url } = useCluster();
|
|
||||||
const details = useTransactionDetails(signature);
|
const details = useTransactionDetails(signature);
|
||||||
const fetchDetails = useFetchTransactionDetails();
|
const fetchDetails = useFetchTransactionDetails();
|
||||||
const fetchStatus = useFetchTransactionStatus();
|
const fetchStatus = useFetchTransactionStatus();
|
||||||
|
@ -314,17 +312,14 @@ function AccountsCard({
|
||||||
} else if (!details || details.status === FetchStatus.Fetching) {
|
} else if (!details || details.status === FetchStatus.Fetching) {
|
||||||
return <LoadingCard />;
|
return <LoadingCard />;
|
||||||
} else if (details.status === FetchStatus.FetchFailed) {
|
} else if (details.status === FetchStatus.FetchFailed) {
|
||||||
return <ErrorCard retry={refreshDetails} text="Fetch Failed" />;
|
return <ErrorCard retry={refreshDetails} text="Failed to fetch details" />;
|
||||||
} else if (!details.data?.transaction || !message) {
|
} else if (!details.data?.transaction || !message) {
|
||||||
return <ErrorCard retry={refreshDetails} text="Not Found" />;
|
return <ErrorCard text="Details are not available" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { meta } = details.data.transaction;
|
const { meta } = details.data.transaction;
|
||||||
if (!meta) {
|
if (!meta) {
|
||||||
if (isCached(url, signature)) {
|
return <ErrorCard text="Transaction metadata is missing" />;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return <ErrorCard retry={refreshDetails} text="Metadata Missing" />;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const accountRows = message.accountKeys.map((account, index) => {
|
const accountRows = message.accountKeys.map((account, index) => {
|
||||||
|
|
|
@ -1,290 +0,0 @@
|
||||||
/**
|
|
||||||
* TEMPORARY
|
|
||||||
*
|
|
||||||
* Adds the ability cache select transactions from mainnet-beta and return them as
|
|
||||||
* if they came from the RPC node itself, until we have a longer transaction history
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { TransactionStatusInfo } from "./index";
|
|
||||||
import {
|
|
||||||
Transaction,
|
|
||||||
ParsedConfirmedTransaction,
|
|
||||||
Message,
|
|
||||||
clusterApiUrl,
|
|
||||||
} from "@solana/web3.js";
|
|
||||||
import { intoParsedTransaction } from "utils/tx";
|
|
||||||
|
|
||||||
export const isCached = (url: string, signature: string): boolean => {
|
|
||||||
return url === clusterApiUrl("mainnet-beta") && signature in CACHED_STATUSES;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const CACHED_STATUSES: { [key: string]: TransactionStatusInfo } = {
|
|
||||||
uQf4pS38FjRF294QFEXizhYkZFjSR9ZSBvvV6MV5b4VpdfRnK3PY9TWZ2qHMQKtte3XwKVLcWqsTF6wL9NEZMty: {
|
|
||||||
slot: 10440804,
|
|
||||||
result: { err: null },
|
|
||||||
timestamp: 1589212180,
|
|
||||||
confirmations: "max",
|
|
||||||
},
|
|
||||||
DYrfStEEzbV5sftX8LgUa54Nwnc5m5E1731cqBtiiC66TeXgKpfqZEQTuFY3vhHZ2K1BsaFM3X9FqisR28EtZr8: {
|
|
||||||
slot: 10451288,
|
|
||||||
result: { err: null },
|
|
||||||
timestamp: 1589216984,
|
|
||||||
confirmations: "max",
|
|
||||||
},
|
|
||||||
"3bLx2PLpkxCxJA5P7HVe8asFdSWXVAh1DrxfkqWE9bWvPRxXE2hqwj1vuSC858fUw3XAGQcHbJknhtNdxY2sehab": {
|
|
||||||
slot: 10516588,
|
|
||||||
result: { err: null },
|
|
||||||
timestamp: 1589247117,
|
|
||||||
confirmations: "max",
|
|
||||||
},
|
|
||||||
"3fE8xNgyxbwbvA5MX3wM87ahDDgCVEaaMMSa8UCWWNxojaRYBgrQyiKXLSxcryMWb7sEyVLBWyqUaRWnQCroSqjY": {
|
|
||||||
slot: 10575124,
|
|
||||||
result: { err: null },
|
|
||||||
timestamp: 1589274236,
|
|
||||||
confirmations: "max",
|
|
||||||
},
|
|
||||||
"5PWymGjKV7T1oqeqGn139EHFyjNM2dnNhHCUcfD2bmdj8cfF95HpY1uJ84W89c4sJQnmyZxXcYrcjumx2jHUvxZQ": {
|
|
||||||
slot: 12447825,
|
|
||||||
result: { err: null },
|
|
||||||
timestamp: 15901860565,
|
|
||||||
confirmations: "max",
|
|
||||||
},
|
|
||||||
"5K4KuqTTRNtzfpxWiwnkePzGfsa3tBEmpMy7vQFR3KWFAZNVY9tvoSaz1Yt5dKxcgsZPio2EsASVDGbQB1HvirGD": {
|
|
||||||
slot: 12450728,
|
|
||||||
result: { err: null },
|
|
||||||
timestamp: 15901874549,
|
|
||||||
confirmations: "max",
|
|
||||||
},
|
|
||||||
"45pGoC4Rr3fJ1TKrsiRkhHRbdUeX7633XAGVec6XzVdpRbzQgHhe6ZC6Uq164MPWtiqMg7wCkC6Wy3jy2BqsDEKf": {
|
|
||||||
slot: 12972684,
|
|
||||||
result: { err: null },
|
|
||||||
timestamp: 1590432412,
|
|
||||||
confirmations: "max",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const CACHED_DETAILS: { [key: string]: ParsedConfirmedTransaction } = {
|
|
||||||
uQf4pS38FjRF294QFEXizhYkZFjSR9ZSBvvV6MV5b4VpdfRnK3PY9TWZ2qHMQKtte3XwKVLcWqsTF6wL9NEZMty: {
|
|
||||||
meta: null,
|
|
||||||
slot: 10440804,
|
|
||||||
transaction: intoParsedTransaction(
|
|
||||||
Transaction.populate(
|
|
||||||
new Message({
|
|
||||||
accountKeys: [
|
|
||||||
"2ojv9BAiHUrvsm9gxDe7fJSzbNZSJcxZvf8dqmWGHG8S",
|
|
||||||
"4C6NCcLPUgGuBBkV2dJW96mrptMUCp3RG1ft9rqwjFi9",
|
|
||||||
"11111111111111111111111111111111",
|
|
||||||
],
|
|
||||||
header: {
|
|
||||||
numReadonlySignedAccounts: 0,
|
|
||||||
numReadonlyUnsignedAccounts: 1,
|
|
||||||
numRequiredSignatures: 1,
|
|
||||||
},
|
|
||||||
instructions: [
|
|
||||||
{ accounts: [0, 1], data: "3Bxs411UBrj8QXUb", programIdIndex: 2 },
|
|
||||||
],
|
|
||||||
recentBlockhash: "5Aw8MaMYdYtnfJyyrregWMWGgiMtWZ6GtRzeP6Ufo65Z",
|
|
||||||
}),
|
|
||||||
[
|
|
||||||
"uQf4pS38FjRF294QFEXizhYkZFjSR9ZSBvvV6MV5b4VpdfRnK3PY9TWZ2qHMQKtte3XwKVLcWqsTF6wL9NEZMty",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
DYrfStEEzbV5sftX8LgUa54Nwnc5m5E1731cqBtiiC66TeXgKpfqZEQTuFY3vhHZ2K1BsaFM3X9FqisR28EtZr8: {
|
|
||||||
meta: null,
|
|
||||||
slot: 10451288,
|
|
||||||
transaction: intoParsedTransaction(
|
|
||||||
Transaction.populate(
|
|
||||||
new Message({
|
|
||||||
accountKeys: [
|
|
||||||
"2ojv9BAiHUrvsm9gxDe7fJSzbNZSJcxZvf8dqmWGHG8S",
|
|
||||||
"4C6NCcLPUgGuBBkV2dJW96mrptMUCp3RG1ft9rqwjFi9",
|
|
||||||
"11111111111111111111111111111111",
|
|
||||||
],
|
|
||||||
header: {
|
|
||||||
numReadonlySignedAccounts: 0,
|
|
||||||
numReadonlyUnsignedAccounts: 1,
|
|
||||||
numRequiredSignatures: 1,
|
|
||||||
},
|
|
||||||
instructions: [
|
|
||||||
{
|
|
||||||
accounts: [0, 1],
|
|
||||||
data: "3Bxs3zwYHuDo723R",
|
|
||||||
programIdIndex: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
recentBlockhash: "4hXYcBdfcadcjfWV17ZwMa4MXe8kbZHYHwr3GzfyqunL",
|
|
||||||
}),
|
|
||||||
[
|
|
||||||
"DYrfStEEzbV5sftX8LgUa54Nwnc5m5E1731cqBtiiC66TeXgKpfqZEQTuFY3vhHZ2K1BsaFM3X9FqisR28EtZr8",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
"3bLx2PLpkxCxJA5P7HVe8asFdSWXVAh1DrxfkqWE9bWvPRxXE2hqwj1vuSC858fUw3XAGQcHbJknhtNdxY2sehab": {
|
|
||||||
meta: null,
|
|
||||||
slot: 10516588,
|
|
||||||
transaction: intoParsedTransaction(
|
|
||||||
Transaction.populate(
|
|
||||||
new Message({
|
|
||||||
accountKeys: [
|
|
||||||
"2ojv9BAiHUrvsm9gxDe7fJSzbNZSJcxZvf8dqmWGHG8S",
|
|
||||||
"4C6NCcLPUgGuBBkV2dJW96mrptMUCp3RG1ft9rqwjFi9",
|
|
||||||
"11111111111111111111111111111111",
|
|
||||||
],
|
|
||||||
header: {
|
|
||||||
numReadonlySignedAccounts: 0,
|
|
||||||
numReadonlyUnsignedAccounts: 1,
|
|
||||||
numRequiredSignatures: 1,
|
|
||||||
},
|
|
||||||
instructions: [
|
|
||||||
{
|
|
||||||
accounts: [0, 1],
|
|
||||||
data: "3Bxs3zwYHuDo723R",
|
|
||||||
programIdIndex: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
recentBlockhash: "HSzTGt3PJMeQtFr94gEdeZqTRaBxgS8Wf1zq3MDdNT3L",
|
|
||||||
}),
|
|
||||||
[
|
|
||||||
"3bLx2PLpkxCxJA5P7HVe8asFdSWXVAh1DrxfkqWE9bWvPRxXE2hqwj1vuSC858fUw3XAGQcHbJknhtNdxY2sehab",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
"3fE8xNgyxbwbvA5MX3wM87ahDDgCVEaaMMSa8UCWWNxojaRYBgrQyiKXLSxcryMWb7sEyVLBWyqUaRWnQCroSqjY": {
|
|
||||||
meta: null,
|
|
||||||
slot: 10575124,
|
|
||||||
transaction: intoParsedTransaction(
|
|
||||||
Transaction.populate(
|
|
||||||
new Message({
|
|
||||||
accountKeys: [
|
|
||||||
"2ojv9BAiHUrvsm9gxDe7fJSzbNZSJcxZvf8dqmWGHG8S",
|
|
||||||
"4C6NCcLPUgGuBBkV2dJW96mrptMUCp3RG1ft9rqwjFi9",
|
|
||||||
"11111111111111111111111111111111",
|
|
||||||
],
|
|
||||||
header: {
|
|
||||||
numReadonlySignedAccounts: 0,
|
|
||||||
numReadonlyUnsignedAccounts: 1,
|
|
||||||
numRequiredSignatures: 1,
|
|
||||||
},
|
|
||||||
instructions: [
|
|
||||||
{
|
|
||||||
accounts: [0, 1],
|
|
||||||
data: "3Bxs3zuKU6mRKSqD",
|
|
||||||
programIdIndex: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
recentBlockhash: "6f6TBMhUoypfR5HHnEqC6VoooKxEcNad5W3Sf63j9MSD",
|
|
||||||
}),
|
|
||||||
[
|
|
||||||
"3fE8xNgyxbwbvA5MX3wM87ahDDgCVEaaMMSa8UCWWNxojaRYBgrQyiKXLSxcryMWb7sEyVLBWyqUaRWnQCroSqjY",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
"5PWymGjKV7T1oqeqGn139EHFyjNM2dnNhHCUcfD2bmdj8cfF95HpY1uJ84W89c4sJQnmyZxXcYrcjumx2jHUvxZQ": {
|
|
||||||
meta: null,
|
|
||||||
slot: 12447825,
|
|
||||||
transaction: intoParsedTransaction(
|
|
||||||
Transaction.populate(
|
|
||||||
new Message({
|
|
||||||
accountKeys: [
|
|
||||||
"HCV5dGFJXRrJ3jhDYA4DCeb9TEDTwGGYXtT3wHksu2Zr",
|
|
||||||
"4C6NCcLPUgGuBBkV2dJW96mrptMUCp3RG1ft9rqwjFi9",
|
|
||||||
"11111111111111111111111111111111",
|
|
||||||
],
|
|
||||||
header: {
|
|
||||||
numReadonlySignedAccounts: 0,
|
|
||||||
numReadonlyUnsignedAccounts: 1,
|
|
||||||
numRequiredSignatures: 1,
|
|
||||||
},
|
|
||||||
instructions: [
|
|
||||||
{
|
|
||||||
accounts: [0, 1],
|
|
||||||
data: "3Bxs3zrfhSqZJTR1",
|
|
||||||
programIdIndex: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
recentBlockhash: "3HJNFraT7XGAqMrQs83EKwDGB6LpHVwUMQKGaYMNY49E",
|
|
||||||
}),
|
|
||||||
[
|
|
||||||
"5PWymGjKV7T1oqeqGn139EHFyjNM2dnNhHCUcfD2bmdj8cfF95HpY1uJ84W89c4sJQnmyZxXcYrcjumx2jHUvxZQ",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
"5K4KuqTTRNtzfpxWiwnkePzGfsa3tBEmpMy7vQFR3KWFAZNVY9tvoSaz1Yt5dKxcgsZPio2EsASVDGbQB1HvirGD": {
|
|
||||||
meta: null,
|
|
||||||
slot: 12450728,
|
|
||||||
transaction: intoParsedTransaction(
|
|
||||||
Transaction.populate(
|
|
||||||
new Message({
|
|
||||||
accountKeys: [
|
|
||||||
"6yKHERk8rsbmJxvMpPuwPs1ct3hRiP7xaJF2tvnGU6nK",
|
|
||||||
"4C6NCcLPUgGuBBkV2dJW96mrptMUCp3RG1ft9rqwjFi9",
|
|
||||||
"3o6xgkJ9sTmDeQWyfj3sxwon18fXJB9PV5LDc8sfgR4a",
|
|
||||||
"11111111111111111111111111111111",
|
|
||||||
],
|
|
||||||
header: {
|
|
||||||
numReadonlySignedAccounts: 0,
|
|
||||||
numReadonlyUnsignedAccounts: 1,
|
|
||||||
numRequiredSignatures: 2,
|
|
||||||
},
|
|
||||||
instructions: [
|
|
||||||
{
|
|
||||||
accounts: [1, 2],
|
|
||||||
data: "3Bxs3ztRCp3tH1yZ",
|
|
||||||
programIdIndex: 3,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
recentBlockhash: "8eXVUNRxrDgpsEuoTWyLay1LUh2djc3Y8cw2owXRN8cU",
|
|
||||||
}),
|
|
||||||
[
|
|
||||||
"5K4KuqTTRNtzfpxWiwnkePzGfsa3tBEmpMy7vQFR3KWFAZNVY9tvoSaz1Yt5dKxcgsZPio2EsASVDGbQB1HvirGD",
|
|
||||||
"37tvpG1eAeEBizJPhJvmpC2BY8npwy6K1wrZdNwdRAfWSbkerY3ZwYAPMHbrzoq7tthvWC2qFU28niqLPxbukeXF",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
"45pGoC4Rr3fJ1TKrsiRkhHRbdUeX7633XAGVec6XzVdpRbzQgHhe6ZC6Uq164MPWtiqMg7wCkC6Wy3jy2BqsDEKf": {
|
|
||||||
meta: null,
|
|
||||||
slot: 12972684,
|
|
||||||
transaction: intoParsedTransaction(
|
|
||||||
Transaction.populate(
|
|
||||||
new Message({
|
|
||||||
accountKeys: [
|
|
||||||
"6yKHERk8rsbmJxvMpPuwPs1ct3hRiP7xaJF2tvnGU6nK",
|
|
||||||
"3o6xgkJ9sTmDeQWyfj3sxwon18fXJB9PV5LDc8sfgR4a",
|
|
||||||
"1nc1nerator11111111111111111111111111111111",
|
|
||||||
"11111111111111111111111111111111",
|
|
||||||
],
|
|
||||||
header: {
|
|
||||||
numReadonlySignedAccounts: 0,
|
|
||||||
numReadonlyUnsignedAccounts: 1,
|
|
||||||
numRequiredSignatures: 2,
|
|
||||||
},
|
|
||||||
instructions: [
|
|
||||||
{
|
|
||||||
accounts: [1, 2],
|
|
||||||
data: "3Bxs4NNAyLXRbuZZ",
|
|
||||||
programIdIndex: 3,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
recentBlockhash: "2xnatNUtSbeMRwi3k4vxPwXxeKFQYVuCNRg2rAgydWVP",
|
|
||||||
}),
|
|
||||||
[
|
|
||||||
"45pGoC4Rr3fJ1TKrsiRkhHRbdUeX7633XAGVec6XzVdpRbzQgHhe6ZC6Uq164MPWtiqMg7wCkC6Wy3jy2BqsDEKf",
|
|
||||||
"2E7CDMTssxTYkdetCKVWQv9X2KNDPiuZrT2Y7647PhFEXuAWWxmHJb3ryCmP29ocQ1SNc7VyJjjm4X3jE8xWDmGY",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
|
||||||
};
|
|
|
@ -6,7 +6,6 @@ import {
|
||||||
ParsedConfirmedTransaction,
|
ParsedConfirmedTransaction,
|
||||||
} from "@solana/web3.js";
|
} from "@solana/web3.js";
|
||||||
import { useCluster, Cluster } from "../cluster";
|
import { useCluster, Cluster } from "../cluster";
|
||||||
import { CACHED_DETAILS, isCached } from "./cached";
|
|
||||||
import * as Cache from "providers/cache";
|
import * as Cache from "providers/cache";
|
||||||
import { ActionType, FetchStatus } from "providers/cache";
|
import { ActionType, FetchStatus } from "providers/cache";
|
||||||
|
|
||||||
|
@ -55,21 +54,16 @@ async function fetchDetails(
|
||||||
|
|
||||||
let fetchStatus;
|
let fetchStatus;
|
||||||
let transaction;
|
let transaction;
|
||||||
if (isCached(url, signature)) {
|
try {
|
||||||
transaction = CACHED_DETAILS[signature];
|
transaction = await new Connection(url).getParsedConfirmedTransaction(
|
||||||
|
signature
|
||||||
|
);
|
||||||
fetchStatus = FetchStatus.Fetched;
|
fetchStatus = FetchStatus.Fetched;
|
||||||
} else {
|
} catch (error) {
|
||||||
try {
|
if (cluster !== Cluster.Custom) {
|
||||||
transaction = await new Connection(url).getParsedConfirmedTransaction(
|
Sentry.captureException(error, { tags: { url } });
|
||||||
signature
|
|
||||||
);
|
|
||||||
fetchStatus = FetchStatus.Fetched;
|
|
||||||
} catch (error) {
|
|
||||||
if (cluster !== Cluster.Custom) {
|
|
||||||
Sentry.captureException(error, { tags: { url } });
|
|
||||||
}
|
|
||||||
fetchStatus = FetchStatus.FetchFailed;
|
|
||||||
}
|
}
|
||||||
|
fetchStatus = FetchStatus.FetchFailed;
|
||||||
}
|
}
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ActionType.Update,
|
type: ActionType.Update,
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { useCluster, Cluster } from "../cluster";
|
||||||
import { DetailsProvider } from "./details";
|
import { DetailsProvider } from "./details";
|
||||||
import * as Cache from "providers/cache";
|
import * as Cache from "providers/cache";
|
||||||
import { ActionType, FetchStatus } from "providers/cache";
|
import { ActionType, FetchStatus } from "providers/cache";
|
||||||
import { CACHED_STATUSES, isCached } from "./cached";
|
|
||||||
export { useTransactionDetails } from "./details";
|
export { useTransactionDetails } from "./details";
|
||||||
|
|
||||||
export type Confirmations = number | "max";
|
export type Confirmations = number | "max";
|
||||||
|
@ -68,54 +67,47 @@ export async function fetchTransactionStatus(
|
||||||
|
|
||||||
let fetchStatus;
|
let fetchStatus;
|
||||||
let data;
|
let data;
|
||||||
if (isCached(url, signature)) {
|
try {
|
||||||
const info = CACHED_STATUSES[signature];
|
const connection = new Connection(url);
|
||||||
|
const { value } = await connection.getSignatureStatus(signature, {
|
||||||
|
searchTransactionHistory: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
let info = null;
|
||||||
|
if (value !== null) {
|
||||||
|
let blockTime = null;
|
||||||
|
try {
|
||||||
|
blockTime = await connection.getBlockTime(value.slot);
|
||||||
|
} catch (error) {
|
||||||
|
if (cluster === Cluster.MainnetBeta) {
|
||||||
|
Sentry.captureException(error, {
|
||||||
|
tags: { slot: `${value.slot}` },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let timestamp: Timestamp = blockTime !== null ? blockTime : "unavailable";
|
||||||
|
|
||||||
|
let confirmations: Confirmations;
|
||||||
|
if (typeof value.confirmations === "number") {
|
||||||
|
confirmations = value.confirmations;
|
||||||
|
} else {
|
||||||
|
confirmations = "max";
|
||||||
|
}
|
||||||
|
|
||||||
|
info = {
|
||||||
|
slot: value.slot,
|
||||||
|
timestamp,
|
||||||
|
confirmations,
|
||||||
|
result: { err: value.err },
|
||||||
|
};
|
||||||
|
}
|
||||||
data = { signature, info };
|
data = { signature, info };
|
||||||
fetchStatus = FetchStatus.Fetched;
|
fetchStatus = FetchStatus.Fetched;
|
||||||
} else {
|
} catch (error) {
|
||||||
try {
|
if (cluster !== Cluster.Custom) {
|
||||||
const connection = new Connection(url);
|
Sentry.captureException(error, { tags: { url } });
|
||||||
const { value } = await connection.getSignatureStatus(signature, {
|
|
||||||
searchTransactionHistory: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
let info = null;
|
|
||||||
if (value !== null) {
|
|
||||||
let blockTime = null;
|
|
||||||
try {
|
|
||||||
blockTime = await connection.getBlockTime(value.slot);
|
|
||||||
} catch (error) {
|
|
||||||
if (cluster === Cluster.MainnetBeta) {
|
|
||||||
Sentry.captureException(error, {
|
|
||||||
tags: { slot: `${value.slot}` },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let timestamp: Timestamp =
|
|
||||||
blockTime !== null ? blockTime : "unavailable";
|
|
||||||
|
|
||||||
let confirmations: Confirmations;
|
|
||||||
if (typeof value.confirmations === "number") {
|
|
||||||
confirmations = value.confirmations;
|
|
||||||
} else {
|
|
||||||
confirmations = "max";
|
|
||||||
}
|
|
||||||
|
|
||||||
info = {
|
|
||||||
slot: value.slot,
|
|
||||||
timestamp,
|
|
||||||
confirmations,
|
|
||||||
result: { err: value.err },
|
|
||||||
};
|
|
||||||
}
|
|
||||||
data = { signature, info };
|
|
||||||
fetchStatus = FetchStatus.Fetched;
|
|
||||||
} catch (error) {
|
|
||||||
if (cluster !== Cluster.Custom) {
|
|
||||||
Sentry.captureException(error, { tags: { url } });
|
|
||||||
}
|
|
||||||
fetchStatus = FetchStatus.FetchFailed;
|
|
||||||
}
|
}
|
||||||
|
fetchStatus = FetchStatus.FetchFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|
Loading…
Reference in New Issue