From f883ed3264b40ff34438c165223c6ba6357fd4dc Mon Sep 17 00:00:00 2001 From: Dawid Szlachta Date: Tue, 30 May 2023 10:03:29 +0200 Subject: [PATCH 1/3] Added removal of a trailing slash from CORE_URL --- src/ui/State.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/State.tsx b/src/ui/State.tsx index 138d096e..c27e3742 100644 --- a/src/ui/State.tsx +++ b/src/ui/State.tsx @@ -296,10 +296,12 @@ export const useGlobalState2 = () => { const apiProvider = new URL(process.env.CORE_URL || 'http://localhost:8080'); const host = apiProvider.hostname; const port = parseInt(apiProvider.port, 10); + return ({ host, port, - apiProvider: apiProvider.href, + // Remove trailing slash if any + apiProvider: apiProvider.href.replace(/\/$/, ''), }); }; From 69af65c9a5f7daa1103166311ac1b329cd94bf9e Mon Sep 17 00:00:00 2001 From: tjayrush Date: Mon, 21 Aug 2023 08:47:12 -0400 Subject: [PATCH 2/3] Fixes for v1.0.0 --- package.json | 2 +- src/ui/App.tsx | 1 + src/ui/datastore/worker/transactions.ts | 2 +- src/ui/modules/types/Reconciliation.tsx | 8 ++++---- src/ui/modules/types/models/Transaction.ts | 1 + .../Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx | 10 +++++----- .../Dashboard/Tabs/Details/components/ReconIcon.tsx | 4 ++-- .../Dashboard/Tabs/Details/components/Statement.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 +++++----- 14 files changed, 31 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index bd63d840..293b7059 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": "^0.70.1", + "trueblocks-sdk": "^1.0.1", "ts-morph": "^13.0.2" } } 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/Reconciliation.tsx index cea1e126..4c6251ac 100644 --- a/src/ui/modules/types/Reconciliation.tsx +++ b/src/ui/modules/types/Reconciliation.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/models/Transaction.ts b/src/ui/modules/types/models/Transaction.ts index b4d457d7..ff48f017 100644 --- a/src/ui/modules/types/models/Transaction.ts +++ b/src/ui/modules/types/models/Transaction.ts @@ -8,4 +8,5 @@ export type TransactionModel = toName?: Name, staging: boolean, chain: string, + extraData?: string, } 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/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/Statement.tsx b/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx index b0c0435a..5ffd1f38 100644 --- a/src/ui/views/Dashboard/Tabs/Details/components/Statement.tsx +++ b/src/ui/views/Dashboard/Tabs/Details/components/Statement.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 Statement12 = ({ 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..ac80c8a0 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 { Statement12 } from './Statement'; 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..ab94877c 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, + // logLevel: 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 fbdf7973..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.70.1 + 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.70.1": - version: 0.70.1 - resolution: "trueblocks-sdk@npm:0.70.1" +"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: c4a729b00d169c8c7ce0c6a8a892b3b3ce52a8532ed5da749cda70f401ac66a1a253bde987bc5618b41d2f0f538da66c6b63d72cc74d7cef62da6b01a2d0d48c + checksum: af2c898ef7798efc8e78b5bac1edc7ef6493c3c3449d501007794df722be6fc5df4deeaa99ebf5457e2ea3db5be199269b7aca92511a123f29161f296f36f440 languageName: node linkType: hard From c665d60663d8c597d19d279d11f0f211edb2d9b1 Mon Sep 17 00:00:00 2001 From: tjayrush Date: Sat, 25 Nov 2023 15:11:07 -0500 Subject: [PATCH 3/3] Bumps version to v2.1.0-release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 293b7059..5f2dd49e 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": "^1.0.1", + "trueblocks-sdk": "^2.1.0", "ts-morph": "^13.0.2" } }