From fc22417c1e7172274e7f5b2c3e066efae48419bf Mon Sep 17 00:00:00 2001 From: Thomas Jay Rush Date: Fri, 25 Aug 2023 16:12:30 -0400 Subject: [PATCH] Catching up to version 1.0.0 of core --- src/ui/App.tsx | 1 + src/ui/datastore/worker/transactions.ts | 2 +- .../types/{Reconciliation.tsx => Statement.tsx} | 8 ++++---- src/ui/modules/types/index.tsx | 2 +- .../Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx | 10 +++++----- .../views/Dashboard/Tabs/Details/components/Pills.tsx | 2 +- .../Dashboard/Tabs/Details/components/ReconIcon.tsx | 4 ++-- .../Tabs/Details/components/RenderedAddress.tsx | 2 +- .../{Statement.tsx => StatementComponent.tsx} | 4 ++-- .../Tabs/Details/components/StatementDisplay.tsx | 8 ++++---- src/ui/views/Dashboard/Tabs/Monitors.tsx | 1 + src/ui/views/Explorer/Tabs/Blocks.tsx | 4 ++-- src/ui/views/Names/Tabs/SubTabs/GenericSubTab.tsx | 2 +- src/ui/views/Settings/Tabs/Indexes.tsx | 1 + yarn.lock | 10 +++++----- 15 files changed, 32 insertions(+), 29 deletions(-) rename src/ui/modules/types/{Reconciliation.tsx => Statement.tsx} (76%) rename src/ui/views/Dashboard/Tabs/Details/components/{Statement.tsx => StatementComponent.tsx} (95%) diff --git a/src/ui/App.tsx b/src/ui/App.tsx index fe0256c7..df5925b4 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -100,6 +100,7 @@ export const App = () => { chain: chain.chain, fmt: 'json', verbose: true, + chains: true, })); if (isSuccessfulCall(statusResponse)) { diff --git a/src/ui/datastore/worker/transactions.ts b/src/ui/datastore/worker/transactions.ts index eeb180a4..d78badbb 100644 --- a/src/ui/datastore/worker/transactions.ts +++ b/src/ui/datastore/worker/transactions.ts @@ -18,7 +18,7 @@ async function fetchTransactions(chain: string, addresses: Address[], loaded: nu articulate: true, accounting: true, // reversed: false, - relevant: true, + // relevant: true, // summarize_by: 'monthly', firstRecord: loaded + 1, maxRecords: (() => { diff --git a/src/ui/modules/types/Reconciliation.tsx b/src/ui/modules/types/Statement.tsx similarity index 76% rename from src/ui/modules/types/Reconciliation.tsx rename to src/ui/modules/types/Statement.tsx index cea1e126..4c6251ac 100644 --- a/src/ui/modules/types/Reconciliation.tsx +++ b/src/ui/modules/types/Statement.tsx @@ -1,11 +1,11 @@ -import { Reconciliation } from 'trueblocks-sdk'; +import { Statement } from 'trueblocks-sdk'; //----------------------------------------------------------------- -export const priceReconciliation = (statementIn: Reconciliation, denom: string) => { +export const priceReconciliation = (statementIn: Statement, denom: string) => { if (denom === 'ether') { return statementIn; } - const statement: Reconciliation = JSON.parse(JSON.stringify(statementIn)); - const properties: Array = [ + const statement: Statement = JSON.parse(JSON.stringify(statementIn)); + const properties: Array = [ 'prevBal', 'begBal', 'begBalDiff', diff --git a/src/ui/modules/types/index.tsx b/src/ui/modules/types/index.tsx index ea4f989d..442c6c58 100644 --- a/src/ui/modules/types/index.tsx +++ b/src/ui/modules/types/index.tsx @@ -16,5 +16,5 @@ export * from '@modules/types/Accountname'; export * from '@modules/types/AssetHistory'; export * from '@modules/types/Balance'; export * from '@modules/types/ItemCounter'; -export * from '@modules/types/Reconciliation'; +export * from '@modules/types/Statement'; export * from '@modules/types/Tag'; diff --git a/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx b/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx index a851d82d..b40ca6b9 100644 --- a/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useGlobalState } from '@state'; import { Card, Space, Tag } from 'antd'; -import { Reconciliation, Transaction } from 'trueblocks-sdk'; +import { Statement, Transaction } from 'trueblocks-sdk'; import { double, priceReconciliation, @@ -22,7 +22,7 @@ export const HistoryRecons = ({ record, params }: { record: Transaction; params: return (
- {(record?.statements as unknown as Reconciliation[])?.map((statement: Reconciliation, index: number) => { + {(record?.statements as unknown as Statement[])?.map((statement: Statement, index: number) => { const statementIn = priceReconciliation(statement, denom); return oneStatement(statementIn, index, userPrefs.showDetails, userPrefs.setShowDetails, styles, key); })} @@ -34,7 +34,7 @@ export const HistoryRecons = ({ record, params }: { record: Transaction; params: declare type stateSetter = React.Dispatch>; const oneStatement = ( - statement: Reconciliation, + statement: Statement, index: number, details: boolean, setShowDetails: stateSetter, @@ -82,7 +82,7 @@ const oneStatement = ( ); //----------------------------------------------------------------- -const statementHeader = (statement: Reconciliation, details: boolean, setShowDetails: any) => { +const statementHeader = (statement: Statement, details: boolean, setShowDetails: any) => { const title = `${statement.assetSymbol} reconciliation`; return (
{ +const statementBody = (statement: Statement, details: boolean, styles: any) => { const preAppBlkStr = statement.prevAppBlk === undefined ? '0' : statement.prevAppBlk.toString(); const rowStyle = styles.tableRow; const detailView = !details ? <> : ( diff --git a/src/ui/views/Dashboard/Tabs/Details/components/Pills.tsx b/src/ui/views/Dashboard/Tabs/Details/components/Pills.tsx index c3544b11..9c11c94a 100644 --- a/src/ui/views/Dashboard/Tabs/Details/components/Pills.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/components/Pills.tsx @@ -6,7 +6,7 @@ import { TransactionModel } from '@modules/types/models/Transaction'; export const Pills = ({ record } : {record: TransactionModel}) => { const style = useStyles(); const isErr = record.isError; - const isInt = record.to !== record.extraData && record.from !== record.extraData; + const isInt = false; // record.to !== record.extraData && record.from !== record.extraData; const isCon = record.to === '0x0'; const is20 = record.toName?.isErc20 || (record?.statements?.length || 0) > 1; const is721 = record.toName?.isErc721; diff --git a/src/ui/views/Dashboard/Tabs/Details/components/ReconIcon.tsx b/src/ui/views/Dashboard/Tabs/Details/components/ReconIcon.tsx index 1f69f150..edd3603d 100644 --- a/src/ui/views/Dashboard/Tabs/Details/components/ReconIcon.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/components/ReconIcon.tsx @@ -8,10 +8,10 @@ import { UpCircleFilled, } from '@ant-design/icons'; import { - Reconciliation, + Statement, } from 'trueblocks-sdk'; -export const ReconIcon = ({ statement }: { statement: Reconciliation }) => { +export const ReconIcon = ({ statement }: { statement: Statement }) => { if (!statement) return <>; let icon = <>; if (statement.reconciled) { diff --git a/src/ui/views/Dashboard/Tabs/Details/components/RenderedAddress.tsx b/src/ui/views/Dashboard/Tabs/Details/components/RenderedAddress.tsx index 08e40e34..c2073669 100644 --- a/src/ui/views/Dashboard/Tabs/Details/components/RenderedAddress.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/components/RenderedAddress.tsx @@ -10,7 +10,7 @@ export const RenderedAddress = ({ record, which }: {record: TransactionModel, wh } const isSpecial = address === '0xPrefund' || address === '0xBlockReward' || address === '0xUncleReward'; - const acctFor = record.extraData; + const acctFor = "UNKNOW"; // record.extraData; const isCurrent = address === acctFor; const nameSource = which === 'from' ? 'fromName' : 'toName'; diff --git a/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx b/src/ui/views/Dashboard/Tabs/Details/components/StatementComponent.tsx similarity index 95% rename from src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx rename to src/ui/views/Dashboard/Tabs/Details/components/StatementComponent.tsx index b0c0435a..80b1ac64 100644 --- a/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/components/StatementComponent.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'; import { createUseStyles } from 'react-jss'; import { useGlobalState } from '@state'; -import { Reconciliation } from 'trueblocks-sdk'; +import { Statement } from 'trueblocks-sdk'; import { priceReconciliation, @@ -10,7 +10,7 @@ import { import { ReconIcon } from './ReconIcon'; -export const Statement = ({ statement }: { statement: Reconciliation }) => { +export const StatementComponent = ({ statement }: { statement: Statement }) => { const style = useStyles(); const k = statement.assetAddr; const { denom } = useGlobalState(); diff --git a/src/ui/views/Dashboard/Tabs/Details/components/StatementDisplay.tsx b/src/ui/views/Dashboard/Tabs/Details/components/StatementDisplay.tsx index c9b50b80..84da1eab 100644 --- a/src/ui/views/Dashboard/Tabs/Details/components/StatementDisplay.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/components/StatementDisplay.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { createUseStyles } from 'react-jss'; -import { Reconciliation, Transaction } from 'trueblocks-sdk'; +import { Statement, Transaction } from 'trueblocks-sdk'; -import { Statement } from './Statement'; +import { StatementComponent } from './StatementComponent'; export const StatementDisplay = ({ record }: { record: Transaction}) => { const style = useStyles(); @@ -20,8 +20,8 @@ export const StatementDisplay = ({ record }: { record: Transaction}) => {
- {(record.statements as unknown as Reconciliation[])?.map((statement, i) => ( - ( + diff --git a/src/ui/views/Dashboard/Tabs/Monitors.tsx b/src/ui/views/Dashboard/Tabs/Monitors.tsx index 80c72450..bd94ba42 100644 --- a/src/ui/views/Dashboard/Tabs/Monitors.tsx +++ b/src/ui/views/Dashboard/Tabs/Monitors.tsx @@ -44,6 +44,7 @@ export const Monitors = () => { chain: chain.chain, modes: ['monitors'], verbose: true, + chains: true, }), undefined, []) as CallStatus; if (isFailedCall(monitorsCall)) { createErrorNotification({ diff --git a/src/ui/views/Explorer/Tabs/Blocks.tsx b/src/ui/views/Explorer/Tabs/Blocks.tsx index f7b32fbf..b70bf33a 100644 --- a/src/ui/views/Explorer/Tabs/Blocks.tsx +++ b/src/ui/views/Explorer/Tabs/Blocks.tsx @@ -19,8 +19,8 @@ export const Blocks = () => { const blocksCall = useSdk(() => getBlocks({ chain: chain.chain, blocks: [], - list: 0, - listCount: 12, + // list: 0, + // listCount: 12, cache: true, })); diff --git a/src/ui/views/Names/Tabs/SubTabs/GenericSubTab.tsx b/src/ui/views/Names/Tabs/SubTabs/GenericSubTab.tsx index 85983f01..e3aa4500 100644 --- a/src/ui/views/Names/Tabs/SubTabs/GenericSubTab.tsx +++ b/src/ui/views/Names/Tabs/SubTabs/GenericSubTab.tsx @@ -20,7 +20,7 @@ export function GenericSubTab({ filterFunc, resourceName }: GenericSubTabProps) chain: chain.chain, addrs: [], known: true, - logLevel: 2, + // verbose: 2, })); return ( diff --git a/src/ui/views/Settings/Tabs/Indexes.tsx b/src/ui/views/Settings/Tabs/Indexes.tsx index afa88951..d8c47f66 100644 --- a/src/ui/views/Settings/Tabs/Indexes.tsx +++ b/src/ui/views/Settings/Tabs/Indexes.tsx @@ -31,6 +31,7 @@ export const IndexesView = () => { chain: chain.chain, modes: ['index'], verbose: true, + chains: true, })); const theGridData = useMemo(() => { diff --git a/yarn.lock b/yarn.lock index 0ebe8e82..52a7234b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13663,7 +13663,7 @@ resolve@^2.0.0-next.3: react-test-renderer: ^17.0.2 recharts: ^2.0.9 style-loader: ^2.0.0 - trueblocks-sdk: ^0.64.0 + trueblocks-sdk: ^1.0.1 ts-jest: ^26.5.3 ts-loader: ^8.0.18 ts-morph: ^13.0.2 @@ -13674,13 +13674,13 @@ resolve@^2.0.0-next.3: languageName: unknown linkType: soft -"trueblocks-sdk@npm:^0.64.0": - version: 0.64.0 - resolution: "trueblocks-sdk@npm:0.64.0" +"trueblocks-sdk@npm:^1.0.1": + version: 1.0.1 + resolution: "trueblocks-sdk@npm:1.0.1" dependencies: typescript: ^4.9.4 vitest: ^0.29.2 - checksum: 82ded280f8cfb6e68e089e1fbeb64b56b514d9c050ffbfd5d34d2eec40f9a81a3b600754465d32372eb30ecc4f36f4f2a7d52aa4d898f932524187db87eb1a29 + checksum: af2c898ef7798efc8e78b5bac1edc7ef6493c3c3449d501007794df722be6fc5df4deeaa99ebf5457e2ea3db5be199269b7aca92511a123f29161f296f36f440 languageName: node linkType: hard