diff --git a/explorer/src/components/instruction/RawDetails.tsx b/explorer/src/components/instruction/RawDetails.tsx index 8e64419d33..a9d5d6b7d2 100644 --- a/explorer/src/components/instruction/RawDetails.tsx +++ b/explorer/src/components/instruction/RawDetails.tsx @@ -1,15 +1,7 @@ import React from "react"; import { TransactionInstruction } from "@solana/web3.js"; import { Address } from "components/common/Address"; - -function wrap(input: string, length: number): string { - var result = []; - while (input.length) { - result.push(input.substr(0, length)); - input = input.substr(length); - } - return result.join("\n"); -} +import { wrap } from "utils"; export function RawDetails({ ix }: { ix: TransactionInstruction }) { const data = wrap(ix.data.toString("hex"), 50); diff --git a/explorer/src/components/instruction/bpf-loader/BpfLoaderDetailsCard.tsx b/explorer/src/components/instruction/bpf-loader/BpfLoaderDetailsCard.tsx index 44ea0e0b80..4233bddb6f 100644 --- a/explorer/src/components/instruction/bpf-loader/BpfLoaderDetailsCard.tsx +++ b/explorer/src/components/instruction/bpf-loader/BpfLoaderDetailsCard.tsx @@ -12,6 +12,7 @@ import { IX_STRUCTS } from "./types"; import { reportError } from "utils/sentry"; import { UnknownDetailsCard } from "../UnknownDetailsCard"; import { Address } from "components/common/Address"; +import { wrap } from "utils"; type DetailsProps = { tx: ParsedTransaction; @@ -50,7 +51,7 @@ type Props = { export function BpfLoaderWriteDetailsCard(props: Props) { const { ix, index, result, info } = props; - + const bytes = wrap(info.bytes, 50); return ( (base 64) - {info.bytes} +
{bytes}
diff --git a/explorer/src/components/instruction/stake/types.ts b/explorer/src/components/instruction/stake/types.ts index 3cb9067c85..5abb76cf7f 100644 --- a/explorer/src/components/instruction/stake/types.ts +++ b/explorer/src/components/instruction/stake/types.ts @@ -10,8 +10,8 @@ const Initialize = pick({ withdrawer: Pubkey, }), lockup: pick({ - epoch: number(), unixTimestamp: number(), + epoch: number(), custodian: Pubkey, }), }); diff --git a/explorer/src/utils/index.tsx b/explorer/src/utils/index.tsx index 13fd4a324f..d4f7f01138 100644 --- a/explorer/src/utils/index.tsx +++ b/explorer/src/utils/index.tsx @@ -90,3 +90,12 @@ export function slotsToHumanString( ): string { return HUMANIZER.humanize(slots * slotTime); } + +export function wrap(input: string, length: number): string { + var result = []; + while (input.length) { + result.push(input.substr(0, length)); + input = input.substr(length); + } + return result.join("\n"); +}