diff --git a/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx b/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx
index e41066f126..456be5f086 100644
--- a/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx
+++ b/explorer/src/components/account/UpgradeableLoaderAccountSection.tsx
@@ -13,6 +13,7 @@ import { Slot } from "components/common/Slot";
import { addressLabel } from "utils/tx";
import { useCluster } from "providers/cluster";
import { ErrorCard } from "components/common/ErrorCard";
+import { UnknownAccountCard } from "components/account/UnknownAccountCard";
export function UpgradeableLoaderAccountSection({
account,
@@ -52,6 +53,9 @@ export function UpgradeableLoaderAccountSection({
/>
);
}
+ case "uninitialized": {
+ return ;
+ }
}
}
diff --git a/explorer/src/validators/accounts/upgradeable-program.ts b/explorer/src/validators/accounts/upgradeable-program.ts
index 07aa6416fe..e00183ed59 100644
--- a/explorer/src/validators/accounts/upgradeable-program.ts
+++ b/explorer/src/validators/accounts/upgradeable-program.ts
@@ -9,6 +9,7 @@ import {
union,
coerce,
create,
+ any,
} from "superstruct";
import { ParsedInfo } from "validators";
import { PublicKeyFromString } from "validators/pubkey";
@@ -49,9 +50,27 @@ export const ProgramBufferAccount = type({
info: ProgramBufferAccountInfo,
});
+export type ProgramUninitializedAccountInfo = Infer<
+ typeof ProgramUninitializedAccountInfo
+>;
+export const ProgramUninitializedAccountInfo = any();
+
+export type ProgramUninitializedAccount = Infer<
+ typeof ProgramUninitializedAccount
+>;
+export const ProgramUninitializedAccount = type({
+ type: literal("uninitialized"),
+ info: ProgramUninitializedAccountInfo,
+});
+
export type UpgradeableLoaderAccount = Infer;
export const UpgradeableLoaderAccount = coerce(
- union([ProgramAccount, ProgramDataAccount, ProgramBufferAccount]),
+ union([
+ ProgramAccount,
+ ProgramDataAccount,
+ ProgramBufferAccount,
+ ProgramUninitializedAccount,
+ ]),
ParsedInfo,
(value) => {
// Coercions like `PublicKeyFromString` are not applied within
@@ -75,6 +94,12 @@ export const UpgradeableLoaderAccount = coerce(
info: create(value.info, ProgramBufferAccountInfo),
};
}
+ case "uninitialized": {
+ return {
+ type: value.type,
+ info: create(value.info, ProgramUninitializedAccountInfo),
+ };
+ }
default: {
throw new Error(`Unknown program account type: ${value.type}`);
}