From 0231c6cf05dc2c12c32ecf30cb1b3a8fda507cbe Mon Sep 17 00:00:00 2001 From: hunter <104146303+solhosty@users.noreply.github.com> Date: Fri, 11 Aug 2023 21:05:59 -0400 Subject: [PATCH 1/3] from in ./trpc/transactions to null --- .env.template | 1 - src/lib/trpc/routes/transactions.ts | 26 ++++++++++--------- src/lib/xray/lib/parser/types.ts | 8 +++--- .../concurrent-merkle-tree/+page.svelte | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 .env.template diff --git a/.env.template b/.env.template deleted file mode 100644 index a8b8d7ab..00000000 --- a/.env.template +++ /dev/null @@ -1 +0,0 @@ -HELIUS_KEY = "" \ No newline at end of file diff --git a/src/lib/trpc/routes/transactions.ts b/src/lib/trpc/routes/transactions.ts index b60a2305..99e94ba5 100644 --- a/src/lib/trpc/routes/transactions.ts +++ b/src/lib/trpc/routes/transactions.ts @@ -34,20 +34,22 @@ export const transactions = t.procedure }) ), actions: z.array( - z.object({ - actionType: z.string(), - amount: z.number(), - from: z.string(), - fromName: z.string().optional(), - received: z.string().optional(), - sent: z.string().optional(), - to: z.string(), - toName: z.string().optional(), - }) + z + .object({ + actionType: z.string().optional(), + amount: z.number().optional(), + from: z.string().nullable().optional(), + fromName: z.string().optional(), + received: z.string().optional(), + sent: z.string().optional(), + to: z.string().optional(), + toName: z.string().optional(), + }) + .optional() ), fee: z.number(), - primaryUser: z.string(), - raw: z.any(), + primaryUser: z.string().optional(), + raw: z.any().optional(), signature: z.string(), source: z.string(), timestamp: z.number(), diff --git a/src/lib/xray/lib/parser/types.ts b/src/lib/xray/lib/parser/types.ts index d31a7a7b..065ee961 100644 --- a/src/lib/xray/lib/parser/types.ts +++ b/src/lib/xray/lib/parser/types.ts @@ -1,5 +1,5 @@ -import { EnrichedTransaction, Source, TransactionType } from "helius-sdk"; - +import type { EnrichedTransaction } from "helius-sdk"; +import { Source, TransactionType } from "helius-sdk"; import * as parser from "./parsers"; export const SOL = "So11111111111111111111111111111111111111112"; @@ -138,7 +138,7 @@ export type ProtonParser = ( export interface ProtonTransactionAction { actionType: ProtonActionType; - from: string; + from: string | null; to: string; sent?: string; received?: string; @@ -171,7 +171,7 @@ export type ProtonParsers = Record; export const unknownProtonTransaction: ProtonTransaction = { accounts: [], - actions: [], + actions: [] || [], fee: 0, primaryUser: "", signature: "", diff --git a/src/routes/account/[account]/concurrent-merkle-tree/+page.svelte b/src/routes/account/[account]/concurrent-merkle-tree/+page.svelte index 21f385d5..379fe6ae 100644 --- a/src/routes/account/[account]/concurrent-merkle-tree/+page.svelte +++ b/src/routes/account/[account]/concurrent-merkle-tree/+page.svelte @@ -238,7 +238,7 @@

- {($cmt.data.rightMostIndex).toLocaleString()} + {$cmt.data.rightMostIndex.toLocaleString()}

From 1171ac20b9e36e93dafc17ab136dc4e3de0fccd9 Mon Sep 17 00:00:00 2001 From: hunter <104146303+solhosty@users.noreply.github.com> Date: Fri, 11 Aug 2023 21:09:47 -0400 Subject: [PATCH 2/3] revert others --- src/lib/trpc/routes/transactions.ts | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lib/trpc/routes/transactions.ts b/src/lib/trpc/routes/transactions.ts index 99e94ba5..61b1fc99 100644 --- a/src/lib/trpc/routes/transactions.ts +++ b/src/lib/trpc/routes/transactions.ts @@ -34,22 +34,20 @@ export const transactions = t.procedure }) ), actions: z.array( - z - .object({ - actionType: z.string().optional(), - amount: z.number().optional(), - from: z.string().nullable().optional(), - fromName: z.string().optional(), - received: z.string().optional(), - sent: z.string().optional(), - to: z.string().optional(), - toName: z.string().optional(), - }) - .optional() + z.object({ + actionType: z.string(), + amount: z.number(), + from: z.string().nullable().optional(), + fromName: z.string().optional(), + received: z.string().optional(), + sent: z.string().optional(), + to: z.string(), + toName: z.string().optional(), + }) ), fee: z.number(), - primaryUser: z.string().optional(), - raw: z.any().optional(), + primaryUser: z.string(), + raw: z.any(), signature: z.string(), source: z.string(), timestamp: z.number(), From f5cd1f1a0944a6079106929728b233350ddb09a6 Mon Sep 17 00:00:00 2001 From: hunter <104146303+solhosty@users.noreply.github.com> Date: Fri, 11 Aug 2023 21:12:05 -0400 Subject: [PATCH 3/3] other removals --- src/lib/xray/lib/parser/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/xray/lib/parser/types.ts b/src/lib/xray/lib/parser/types.ts index 065ee961..98ed05a9 100644 --- a/src/lib/xray/lib/parser/types.ts +++ b/src/lib/xray/lib/parser/types.ts @@ -171,7 +171,7 @@ export type ProtonParsers = Record; export const unknownProtonTransaction: ProtonTransaction = { accounts: [], - actions: [] || [], + actions: [], fee: 0, primaryUser: "", signature: "",