+ {// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
+ data ? (
+
+
+
+ ) : (
+
No results
+ )}
+
+ ) : (
+
loading...
+ )}
+
+ );
+};
+
+export default Page;
\ No newline at end of file
diff --git a/src/app/ibc/connections/page.tsx b/src/app/ibc/connections/page.tsx
new file mode 100644
index 0000000..1f0d717
--- /dev/null
+++ b/src/app/ibc/connections/page.tsx
@@ -0,0 +1,9 @@
+const Page = () => {
+ return (
+
+
IBC Connections are not yet implemented...
+
+ );
+};
+
+export default Page;
diff --git a/src/app/ibc/page.tsx b/src/app/ibc/page.tsx
new file mode 100644
index 0000000..f4da06f
--- /dev/null
+++ b/src/app/ibc/page.tsx
@@ -0,0 +1,28 @@
+import Link from "next/link";
+
+const Page = () => {
+ return (
+
+
Available IBC data to explore
+
+
+
+ IBC Clients
+
+
+
+
+ IBC Channels
+
+
+
+
+ IBC Connections
+
+
+
+
+ );
+};
+
+export default Page;
\ No newline at end of file
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 9e8ea16..4170559 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -16,6 +16,11 @@ export default async function Home() {
Recent Blocks
+
+
+ IBC Clients
+
+
);
diff --git a/src/components/Providers/index.tsx b/src/components/Providers/index.tsx
index 2324134..33e7610 100644
--- a/src/components/Providers/index.tsx
+++ b/src/components/Providers/index.tsx
@@ -16,6 +16,11 @@ const Providers = ({ children } : { children: React.ReactNode }) => {
},
queryCache: new QueryCache({
onError: (error, query) => {
+ // TODO: Overall model is fine but need to change how meta is used.
+ // Idea: Add a `errorTitle` field instead that can be used in place of "Error" below. This gives a top level, succinct explanation.
+ // `description` becomes whatever value we store inside our error value. This is what needs to be refactored to make all queries play nicely.
+ // This allows each error to clearly signal its nature while also giving detail where appropriate. The issue of that detail is delegated to the useQuery callsite
+ // and any component/route that throws errors.
// There may be a more elegant way of expressing this but the general typing of onError's `error` and `query` arguments requires some amount of refinement for safety.
// https://tanstack.com/query/latest/docs/react/reference/QueryCache
let errorMessage = "";
diff --git a/src/components/ibc/clients/ClientsTable.tsx b/src/components/ibc/clients/ClientsTable.tsx
new file mode 100644
index 0000000..0c869f1
--- /dev/null
+++ b/src/components/ibc/clients/ClientsTable.tsx
@@ -0,0 +1,30 @@
+import { columns } from "./columns";
+import { DataTable } from "../../ui/data-table";
+// import { type QueryKind } from "@/lib/validators/search";
+import { type FC } from "react";
+
+interface Props {
+ data: Array<{
+ tx_results: {
+ tx_hash: string | null,
+ },
+ blocks: {
+ created_at: string,
+ height: bigint,
+ },
+ attributes: Array<{
+ key: string,
+ value: string,
+ }>,
+ }>,
+}
+
+const ClientsTable : FC = ({ data }) => {
+ return (
+
+
+
+ );
+};
+
+export default ClientsTable;
\ No newline at end of file
diff --git a/src/components/ibc/clients/columns.tsx b/src/components/ibc/clients/columns.tsx
new file mode 100644
index 0000000..48a297d
--- /dev/null
+++ b/src/components/ibc/clients/columns.tsx
@@ -0,0 +1,61 @@
+"use client";
+
+import { type ColumnDef } from "@tanstack/react-table";
+import Link from "next/link";
+
+export interface ClientsColumns {
+ tx_results: {
+ tx_hash: string | null,
+ },
+ blocks: {
+ created_at: string,
+ height: bigint,
+ },
+ attributes: Array<{
+ key: string,
+ value: string,
+ }>,
+};
+
+// TODO formating, styling, etc
+export const columns : Array> = [
+ {
+ accessorKey: "blocks.height",
+ header: () =>
,
+ cell: ({ getValue }) => {
+ const tx = getValue() as Array<{ key: string, value: string | null }>;
+ // TODO: besides styling itself, do better re: null value case for value
+ return (
+
+ {tx.map(({key, value}, index) => (
{key}{value}
))}
+
+ );
+ },
+ },
+];
\ No newline at end of file
diff --git a/src/lib/protobuf.ts b/src/lib/protobuf.ts
index e095c9b..13d1a72 100644
--- a/src/lib/protobuf.ts
+++ b/src/lib/protobuf.ts
@@ -1,7 +1,19 @@
import { TxResult } from "@buf/cosmos_cosmos-sdk.bufbuild_es/tendermint/abci/types_pb";
+// import { MsgCreateClient } from "@buf/cosmos_ibc.bufbuild_es/ibc/core/client/v1/tx_pb";
import { Transaction } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/transaction/v1alpha1/transaction_pb";
+// import { IbcRelay } from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/ibc/v1alpha1/ibc_pb";
+
export const transactionFromBytes = (txBytes : Buffer) => {
const txResult = TxResult.fromBinary(txBytes);
return Transaction.fromBinary(txResult.tx);
+};
+
+// NOTE: As of now, cannot completely decode the Protobuf data for an IBC client related transaction
+// due to ibc.core.client.v1.MsgCreateClient not having a defined URL protobuf schema that can be resolved.
+// What data that can be returned by decoding from TxResult and Transaction is not all that useful.
+export const ibcEventFromBytes = (txBytes : Buffer) : [Transaction, TxResult] => {
+ const ibcEvent = TxResult.fromBinary(txBytes);
+ const tx = Transaction.fromBinary(ibcEvent.tx);
+ return [tx, ibcEvent];
};
\ No newline at end of file