From 90e6dfa243424365fc4b7517bb5043da192b5ab5 Mon Sep 17 00:00:00 2001 From: tjayrush Date: Mon, 19 Dec 2022 22:37:28 -0500 Subject: [PATCH 1/9] Update --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index c90c2e4a..7b8458b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=5a1126&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=fee6d2&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: 1633f02b5eb858ccc685add8675c39f50f9e735b1c831151e432c7e224727a0dad0f1348cf6d11648c3ab72e618a768aeaf2eba4257de8319c270ac6c8b21618 + checksum: 8a0276535bb5d3d3b7593b0f9f582748ea772df8a4f6e45e33a480b6fafa00645a4697959d315320ae8bbb5d659a76ee1a4997c3bc39c1c5094df318ccc4c323 languageName: node linkType: hard From 012e9756a2b4d723978bc5ff1eb6cd129aaf72a4 Mon Sep 17 00:00:00 2001 From: tjayrush Date: Tue, 20 Dec 2022 15:01:36 -0500 Subject: [PATCH 2/9] Updating --- src/ui/datastore/messages.ts | 4 ++-- src/ui/datastore/worker/transactions.ts | 6 +++--- yarn.lock | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui/datastore/messages.ts b/src/ui/datastore/messages.ts index 7276da23..c9d69fae 100644 --- a/src/ui/datastore/messages.ts +++ b/src/ui/datastore/messages.ts @@ -1,5 +1,5 @@ import { - address, getNames, ListStats, Name, + address, AppearanceCount, getNames, Name, } from 'trueblocks-sdk'; import { TransactionFilters } from '@modules/filters/transaction'; @@ -41,7 +41,7 @@ export type GetTransactionsTotal = { addresses: address[], } -export type GetTransactionsTotalResult = ListStats[]; +export type GetTransactionsTotalResult = AppearanceCount[]; export type GetPage = { chain: string, diff --git a/src/ui/datastore/worker/transactions.ts b/src/ui/datastore/worker/transactions.ts index da080035..f1928792 100644 --- a/src/ui/datastore/worker/transactions.ts +++ b/src/ui/datastore/worker/transactions.ts @@ -1,5 +1,5 @@ import { - address as Address, AnyResponse, getExport, getList, ListStats, Name, Transaction, + address as Address, AnyResponse, AppearanceCount, getExport, getList, Name, Transaction, } from 'trueblocks-sdk'; import { isFailedCall, wrapResponse } from '@modules/api/call_status'; @@ -37,14 +37,14 @@ async function fetchTransactions(chain: string, addresses: Address[], loaded: nu return transactions; } -type GetTransactionsTotal = (chain: string, addresses: Address[]) => Promise; +type GetTransactionsTotal = (chain: string, addresses: Address[]) => Promise; export const getTransactionsTotal: GetTransactionsTotal = async (chain, addresses) => { const listCall = wrapResponse((await getList({ chain, count: true, appearances: true, addrs: addresses, - }) as AnyResponse)); + }) as AnyResponse)); if (isFailedCall(listCall)) { throw new Error(listCall.errors.join()); diff --git a/yarn.lock b/yarn.lock index 7b8458b2..5d78e5b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=fee6d2&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=fbcab5&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: 8a0276535bb5d3d3b7593b0f9f582748ea772df8a4f6e45e33a480b6fafa00645a4697959d315320ae8bbb5d659a76ee1a4997c3bc39c1c5094df318ccc4c323 + checksum: e8d237a00bb1d57d7ac3043ecc169bd144e7f54b96c3f22c0019c856d9e8353b79e33b9f6ca0fdfd1a87c94dc01eee5b299a858c89408e9fefc3020312845e3b languageName: node linkType: hard From 3c71cad85271e56a147b6d3587130db5e0d1b850 Mon Sep 17 00:00:00 2001 From: tjayrush Date: Tue, 20 Dec 2022 15:20:42 -0500 Subject: [PATCH 3/9] Updating --- src/ui/datastore/worker/transactions.ts | 1 - yarn.lock | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ui/datastore/worker/transactions.ts b/src/ui/datastore/worker/transactions.ts index f1928792..eeb180a4 100644 --- a/src/ui/datastore/worker/transactions.ts +++ b/src/ui/datastore/worker/transactions.ts @@ -42,7 +42,6 @@ export const getTransactionsTotal: GetTransactionsTotal = async (chain, addresse const listCall = wrapResponse((await getList({ chain, count: true, - appearances: true, addrs: addresses, }) as AnyResponse)); diff --git a/yarn.lock b/yarn.lock index 5d78e5b2..ee2a567c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=fbcab5&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=02a482&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: e8d237a00bb1d57d7ac3043ecc169bd144e7f54b96c3f22c0019c856d9e8353b79e33b9f6ca0fdfd1a87c94dc01eee5b299a858c89408e9fefc3020312845e3b + checksum: d8f711ff7090c8fbe5a5fcfe1643fc67f92950ca5d4b897bedaa4dfdb5e8591b2f96d33644e079d54ddb3f92e4f181200c3de1f6e1a860f2edbe07eae6e72abe languageName: node linkType: hard From 1f4ba4cff5a4e0bbd496b41d4764dcac7f2cfb14 Mon Sep 17 00:00:00 2001 From: tjayrush Date: Tue, 20 Dec 2022 15:43:31 -0500 Subject: [PATCH 4/9] Updating --- src/ui/App.tsx | 8 ++++---- src/ui/components/ChainSelect/index.tsx | 4 ++-- src/ui/components/SidePanels/StatusPanel.tsx | 4 ++-- src/ui/modules/types/{Status.ts => Config.ts} | 4 ++-- src/ui/views/Dashboard/Tabs/Monitors.tsx | 5 +++-- src/ui/views/Settings/Tabs/Indexes.tsx | 2 +- yarn.lock | 4 ++-- 7 files changed, 16 insertions(+), 15 deletions(-) rename src/ui/modules/types/{Status.ts => Config.ts} (91%) diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 2a8ed103..4a0c1358 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -18,7 +18,7 @@ import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; import { Chain, - getConfig, getVersion, Status, SuccessResponse, + Config, getConfig, getVersion, SuccessResponse, } from 'trueblocks-sdk'; import { ChainSelect } from '@components/ChainSelect'; @@ -32,8 +32,8 @@ import { useDatastore } from '@hooks/useDatastore'; import { isFailedCall, isSuccessfulCall, wrapResponse, } from '@modules/api/call_status'; +import { createEmptyStatus } from '@modules/types/Config'; import { createEmptyMeta } from '@modules/types/Meta'; -import { createEmptyStatus } from '@modules/types/Status'; import { ExplorerLocation, NamesLocation, RootLocation, Routes, SettingsLocation, SupportLocation, @@ -60,7 +60,7 @@ export const App = () => { dayjs.extend(relativeTime); const { location, action } = useHistory(); - const [status, setStatus] = useState, 'data' | 'meta'>>({ + const [status, setStatus] = useState, 'data' | 'meta'>>({ data: createEmptyStatus(), meta: createEmptyMeta(), }); @@ -103,7 +103,7 @@ export const App = () => { if (isSuccessfulCall(statusResponse)) { setStatus({ - data: statusResponse.data[0] as Status, + data: statusResponse.data[0] as Config, meta: statusResponse.meta, }); diff --git a/src/ui/components/ChainSelect/index.tsx b/src/ui/components/ChainSelect/index.tsx index 76c517f9..7aa2ee85 100644 --- a/src/ui/components/ChainSelect/index.tsx +++ b/src/ui/components/ChainSelect/index.tsx @@ -3,9 +3,9 @@ import { useHistory } from 'react-router-dom'; import { useGlobalState } from '@state'; import { Select } from 'antd'; -import { Status } from 'trueblocks-sdk'; +import { Config } from 'trueblocks-sdk'; -export function ChainSelect({ status }: { status: Status }) { +export function ChainSelect({ status }: { status: Config }) { const history = useHistory(); const { chain, setChain } = useGlobalState(); diff --git a/src/ui/components/SidePanels/StatusPanel.tsx b/src/ui/components/SidePanels/StatusPanel.tsx index ffa15e4c..3435f1bd 100644 --- a/src/ui/components/SidePanels/StatusPanel.tsx +++ b/src/ui/components/SidePanels/StatusPanel.tsx @@ -6,7 +6,7 @@ import { } from '@ant-design/icons'; import { Badge } from 'antd'; import filesize from 'filesize'; -import { Chain, Status, SuccessResponse } from 'trueblocks-sdk'; +import { Chain, Config, SuccessResponse } from 'trueblocks-sdk'; import { Loading } from '@components/Loading'; import { createEmptyMeta } from '@modules/types/Meta'; @@ -16,7 +16,7 @@ import { useGlobalState2 } from '../../State'; interface StatusPanelProps { // status is always a { data: ..., meta: ... } because of the way we fetch it in App.ts chain: string; - status: Pick, 'data' | 'meta'>; + status: Pick, 'data' | 'meta'>; error: boolean; loading: boolean; } diff --git a/src/ui/modules/types/Status.ts b/src/ui/modules/types/Config.ts similarity index 91% rename from src/ui/modules/types/Status.ts rename to src/ui/modules/types/Config.ts index 7db13379..00901bd4 100644 --- a/src/ui/modules/types/Status.ts +++ b/src/ui/modules/types/Config.ts @@ -1,6 +1,6 @@ -import { Status } from 'trueblocks-sdk'; +import { Config } from 'trueblocks-sdk'; -export function createEmptyStatus(): Status { +export function createEmptyStatus(): Config { return { clientVersion: '', clientIds: '', diff --git a/src/ui/views/Dashboard/Tabs/Monitors.tsx b/src/ui/views/Dashboard/Tabs/Monitors.tsx index bc14b75c..3b3eb561 100644 --- a/src/ui/views/Dashboard/Tabs/Monitors.tsx +++ b/src/ui/views/Dashboard/Tabs/Monitors.tsx @@ -8,7 +8,8 @@ import { } from 'antd'; import { ColumnsType } from 'antd/lib/table'; import { - Chain, getConfig, Monitor, Status, + Chain, Config, + getConfig, Monitor, } from 'trueblocks-sdk'; import { ClickableAddress } from '@components/ClickableAddress'; @@ -44,7 +45,7 @@ export const Monitors = () => { modes: ['show'], module: ['monitors'], details: true, - }), undefined, []) as CallStatus; + }), undefined, []) as CallStatus; if (isFailedCall(monitorsCall)) { createErrorNotification({ description: 'Could not fetch monitors', diff --git a/src/ui/views/Settings/Tabs/Indexes.tsx b/src/ui/views/Settings/Tabs/Indexes.tsx index c0a72442..0571af66 100644 --- a/src/ui/views/Settings/Tabs/Indexes.tsx +++ b/src/ui/views/Settings/Tabs/Indexes.tsx @@ -8,7 +8,7 @@ import { addColumn, addNumColumn } from '@components/Table'; import { useSdk } from '@hooks/useSdk'; import { isFailedCall, isSuccessfulCall } from '@modules/api/call_status'; import { createErrorNotification } from '@modules/error_notification'; -import { createEmptyStatus } from '@modules/types/Status'; +import { createEmptyStatus } from '@modules/types/Config'; import { SettingsIndexesChartsLocation, diff --git a/yarn.lock b/yarn.lock index ee2a567c..a25b340d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=02a482&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=bea883&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: d8f711ff7090c8fbe5a5fcfe1643fc67f92950ca5d4b897bedaa4dfdb5e8591b2f96d33644e079d54ddb3f92e4f181200c3de1f6e1a860f2edbe07eae6e72abe + checksum: f008967e55a1c92f69193b5d9521d991df05013b2cf20b171797d1d463f315bab6b7695921db0873cfbf626c5fdd20dc546c706f368e745b2e7645094e62bbef languageName: node linkType: hard From f462d13bdc45337985d05b7aeb9c764920ca503f Mon Sep 17 00:00:00 2001 From: tjayrush Date: Tue, 20 Dec 2022 15:54:17 -0500 Subject: [PATCH 5/9] Update --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index a25b340d..45e80736 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=bea883&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=e0ec23&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: f008967e55a1c92f69193b5d9521d991df05013b2cf20b171797d1d463f315bab6b7695921db0873cfbf626c5fdd20dc546c706f368e745b2e7645094e62bbef + checksum: 500e5c1d423380c22c7cd6bab17e61d163d8e7b0d835c6504fa0ac4274fc7f217d9a6add2d99d36bc15353c413faa938fd6819725d0bb4d867d68d1aeb290ea3 languageName: node linkType: hard From 6084f54482a5ddc44e4edc13b98221eaa98cea9e Mon Sep 17 00:00:00 2001 From: tjayrush Date: Tue, 20 Dec 2022 21:20:30 -0500 Subject: [PATCH 6/9] Updating --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 45e80736..5e92a5a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=e0ec23&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=f54b85&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: 500e5c1d423380c22c7cd6bab17e61d163d8e7b0d835c6504fa0ac4274fc7f217d9a6add2d99d36bc15353c413faa938fd6819725d0bb4d867d68d1aeb290ea3 + checksum: 902403937ddc879190ad12c8d0e63b2c12904e229be239c248b97f9d83f89cf05b6c87191a4303b9dd5ad4a665052478ca5b35dc7214f2e733c6b735c38d7f80 languageName: node linkType: hard From c1336cd64a55059f48c117951e0c1698b67050fe Mon Sep 17 00:00:00 2001 From: tjayrush Date: Tue, 20 Dec 2022 21:21:49 -0500 Subject: [PATCH 7/9] Updating --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5e92a5a4..d1c34a0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=f54b85&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=d72f8a&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: 902403937ddc879190ad12c8d0e63b2c12904e229be239c248b97f9d83f89cf05b6c87191a4303b9dd5ad4a665052478ca5b35dc7214f2e733c6b735c38d7f80 + checksum: 76e308df9e383c56bc0fbf41c0cf3017bfa8a8d8e81ae12f661a0e11c8dcbace1074ec5242489990ea0dc01e9709d1059c14ee04697f9bd80c65e6752246232f languageName: node linkType: hard From 2498cef88d7f5d317669438b3bdc3362a3c58a6b Mon Sep 17 00:00:00 2001 From: tjayrush Date: Wed, 21 Dec 2022 10:53:05 -0500 Subject: [PATCH 8/9] First version using official released SDK --- package.json | 2 +- src/ui/modules/types/Config.ts | 4 ++ .../Tabs/Details/SubTabs/HistoryRecons.tsx | 43 +++++++++++-------- .../Tabs/Details/components/Statement.tsx | 3 +- yarn.lock | 4 +- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 21ccff58..b089b866 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "react-syntax-highlighter": "^15.4.3", "react-test-renderer": "^17.0.2", "recharts": "^2.0.9", - "trueblocks-sdk": "../trueblocks-sdk", + "trueblocks-sdk": "^0.50.0", "ts-morph": "^13.0.2" } } diff --git a/src/ui/modules/types/Config.ts b/src/ui/modules/types/Config.ts index 00901bd4..2fa258b1 100644 --- a/src/ui/modules/types/Config.ts +++ b/src/ui/modules/types/Config.ts @@ -26,6 +26,7 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, + isValid: false, }, { items: [], @@ -34,6 +35,7 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, + isValid: false, }, { items: [], @@ -42,6 +44,7 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, + isValid: false, }, { items: [], @@ -50,6 +53,7 @@ export function createEmptyStatus(): Config { nFiles: 0, nFolders: 0, sizeInBytes: 0, + isValid: false, }, ], chains: [], diff --git a/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx b/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx index 4da1cd24..a851d82d 100644 --- a/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx @@ -101,13 +101,14 @@ const statementHeader = (statement: Reconciliation, details: boolean, setShowDet //----------------------------------------------------------------- const statementBody = (statement: Reconciliation, details: boolean, styles: any) => { + const preAppBlkStr = statement.prevAppBlk === undefined ? '0' : statement.prevAppBlk.toString(); const rowStyle = styles.tableRow; const detailView = !details ? <> : ( <> {DividerRow(rowStyle)} {DetailRow(rowStyle, 'assetSymbol', statement.assetSymbol)} {DetailRow(rowStyle, 'decimals', statement.decimals)} - {DetailRow(rowStyle, 'prevAppBlk', statement.prevAppBlk.toString())} + {DetailRow(rowStyle, 'prevAppBlk', preAppBlkStr)} {DetailRow(rowStyle, 'blockNumber', statement.blockNumber.toString())} {DetailRow(rowStyle, 'transactionIndex', statement.transactionIndex.toString())} {DetailRow(rowStyle, 'timestamp', statement.timestamp.toString())} @@ -125,30 +126,38 @@ const statementBody = (statement: Reconciliation, details: boolean, styles: any) ); - const toNumberArguments = (...strings: string[]): number[] => strings.map((someString) => ( - someString === '' ? 0.0 : parseFloat(someString))); + const toNumberArguments2 = (v1: string|undefined, v2: string|undefined): number[] => { + const s1 = v1 === undefined ? '0.0' : v1; + const s2 = v2 === undefined ? '0.0' : v2; + return [parseFloat(s1), parseFloat(s2)]; + }; + + const toNumberArguments1 = (v1: string|undefined): number[] => { + const s1 = v1 === undefined ? '0.0' : v1; + return [parseFloat(s1)]; + }; return ( - {BodyRow(rowStyle, 'begBal', details, 0, 0, ...toNumberArguments(statement.begBal, statement.begBalDiff))} - {BodyRow(rowStyle, 'amount', details, ...toNumberArguments(statement.amountIn, statement.amountOut))} - {BodyRow(rowStyle, 'internal', details, ...toNumberArguments(statement.internalIn, statement.internalOut))} + {BodyRow(rowStyle, 'begBal', details, 0, 0, ...toNumberArguments2(statement.begBal, statement.begBalDiff))} + {BodyRow(rowStyle, 'amount', details, ...toNumberArguments2(statement.amountIn, statement.amountOut))} + {BodyRow(rowStyle, 'internal', details, ...toNumberArguments2(statement.internalIn, statement.internalOut))} {BodyRow( rowStyle, 'selfDestruct', details, - ...toNumberArguments(statement.selfDestructIn, statement.selfDestructOut), + ...toNumberArguments2(statement.selfDestructIn, statement.selfDestructOut), )} - {BodyRow(rowStyle, 'baseReward', details, ...toNumberArguments(statement.minerBaseRewardIn), 0)} - {BodyRow(rowStyle, 'txFee', details, ...toNumberArguments(statement.minerTxFeeIn), 0)} - {BodyRow(rowStyle, 'nephewReward', details, ...toNumberArguments(statement.minerNephewRewardIn), 0)} - {BodyRow(rowStyle, 'uncleReward', details, ...toNumberArguments(statement.minerUncleRewardIn), 0)} - {BodyRow(rowStyle, 'prefund', details, ...toNumberArguments(statement.prefundIn), 0)} - {BodyRow(rowStyle, 'gasCost', details, 0, ...toNumberArguments(statement.gasOut))} - {BodyRow(rowStyle, 'totalNet', details, 0, 0, ...toNumberArguments(statement.amountNet))} - {BodyRow(rowStyle, 'endBal', details, 0, 0, ...toNumberArguments(statement.endBal, statement.endBalDiff))} + {BodyRow(rowStyle, 'baseReward', details, ...toNumberArguments1(statement.minerBaseRewardIn), 0)} + {BodyRow(rowStyle, 'txFee', details, ...toNumberArguments1(statement.minerTxFeeIn), 0)} + {BodyRow(rowStyle, 'nephewReward', details, ...toNumberArguments1(statement.minerNephewRewardIn), 0)} + {BodyRow(rowStyle, 'uncleReward', details, ...toNumberArguments1(statement.minerUncleRewardIn), 0)} + {BodyRow(rowStyle, 'prefund', details, ...toNumberArguments1(statement.prefundIn), 0)} + {BodyRow(rowStyle, 'gasCost', details, 0, ...toNumberArguments1(statement.gasOut))} + {BodyRow(rowStyle, 'totalNet', details, 0, 0, ...toNumberArguments1(statement.amountNet))} + {BodyRow(rowStyle, 'endBal', details, 0, 0, ...toNumberArguments2(statement.endBal, statement.endBalDiff))} {detailView}
@@ -211,12 +220,12 @@ const BodyRow = ( }; //----------------------------------------------------------------- -const DetailRow = (style: string, name: string, value: double | string) => { +const DetailRow = (style: string, name: string, value: double | string | undefined) => { const isErr: boolean = name?.includes('Diff') && value !== 0; const valueToDisplay = (() => { if (typeof value === 'number') return clip2(value); - const parsed = parseFloat(value); + const parsed = value ? parseFloat(value) : 0; if (Number.isNaN(parsed)) return value; diff --git a/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx b/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx index ab073510..b0c0435a 100644 --- a/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx @@ -24,6 +24,7 @@ export const Statement = ({ statement }: { statement: Reconciliation }) => { }, [denom, statement.assetSymbol, statement.priceSource]); const pricedRecon = priceReconciliation(statement, denom); + const gasOutStr = pricedRecon.gasOut ? pricedRecon.gasOut.toString() : '0.00'; return ( @@ -39,7 +40,7 @@ export const Statement = ({ statement }: { statement: Reconciliation }) => { {showValue(pricedRecon.totalOutLessGas.toString())} - {showValue(pricedRecon.gasOut.toString(), false, true)} + {showValue(gasOutStr, false, true)} {showValue(pricedRecon.endBal.toString(), true)} diff --git a/yarn.lock b/yarn.lock index d1c34a0e..bcff247d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13018,10 +13018,10 @@ resolve@^2.0.0-next.3: "trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=d72f8a&locator=trueblocks-explorer%40workspace%3A." + resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=cd209f&locator=trueblocks-explorer%40workspace%3A." dependencies: typescript: ^4.9.4 - checksum: 76e308df9e383c56bc0fbf41c0cf3017bfa8a8d8e81ae12f661a0e11c8dcbace1074ec5242489990ea0dc01e9709d1059c14ee04697f9bd80c65e6752246232f + checksum: c32e705e1537c35f24c282a31eaa79964cd0be6f16e952cab4e8084f57e663a972fd696b06ae4437d9321aff8f82e53615fbd84c825f5175151d023d830e87b4 languageName: node linkType: hard From 5d7bc021ae33a97c44abd441c26820e83a64ec19 Mon Sep 17 00:00:00 2001 From: tjayrush Date: Wed, 21 Dec 2022 11:01:36 -0500 Subject: [PATCH 9/9] First version using official released SDK --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index bcff247d..db53713d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13005,7 +13005,7 @@ resolve@^2.0.0-next.3: react-test-renderer: ^17.0.2 recharts: ^2.0.9 style-loader: ^2.0.0 - trueblocks-sdk: ../trueblocks-sdk + trueblocks-sdk: ^0.50.0 ts-jest: ^26.5.3 ts-loader: ^8.0.18 ts-morph: ^13.0.2 @@ -13016,12 +13016,12 @@ resolve@^2.0.0-next.3: languageName: unknown linkType: soft -"trueblocks-sdk@file:../trueblocks-sdk::locator=trueblocks-explorer%40workspace%3A.": - version: 0.45.0 - resolution: "trueblocks-sdk@file:../trueblocks-sdk#../trueblocks-sdk::hash=cd209f&locator=trueblocks-explorer%40workspace%3A." +"trueblocks-sdk@npm:^0.50.0": + version: 0.50.0 + resolution: "trueblocks-sdk@npm:0.50.0" dependencies: typescript: ^4.9.4 - checksum: c32e705e1537c35f24c282a31eaa79964cd0be6f16e952cab4e8084f57e663a972fd696b06ae4437d9321aff8f82e53615fbd84c825f5175151d023d830e87b4 + checksum: e8adf0c915eb65e76567dc9cd13b45dc4cd810b90f0cc954d20e52af7ac03d408e995834b1df12e1df4e2a343675ac8f03960c9560ab454c13238250578d98db languageName: node linkType: hard