Skip to content

Commit

Permalink
Catching up to version 1.0.0 of core
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Aug 25, 2023
1 parent 407d901 commit fc22417
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const App = () => {
chain: chain.chain,
fmt: 'json',
verbose: true,
chains: true,
}));

if (isSuccessfulCall(statusResponse)) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/datastore/worker/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: (() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<keyof Reconciliation> = [
const statement: Statement = JSON.parse(JSON.stringify(statementIn));
const properties: Array<keyof Statement> = [
'prevBal',
'begBal',
'begBalDiff',
Expand Down
2 changes: 1 addition & 1 deletion src/ui/modules/types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
10 changes: 5 additions & 5 deletions src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -22,7 +22,7 @@ export const HistoryRecons = ({ record, params }: { record: Transaction; params:
return (
<div key={key} className={styles.container}>
<div key={key} className={styles.cardHolder}>
{(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);
})}
Expand All @@ -34,7 +34,7 @@ export const HistoryRecons = ({ record, params }: { record: Transaction; params:

declare type stateSetter<Type> = React.Dispatch<React.SetStateAction<Type>>;
const oneStatement = (
statement: Reconciliation,
statement: Statement,
index: number,
details: boolean,
setShowDetails: stateSetter<boolean>,
Expand Down Expand Up @@ -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 (
<div style={{
Expand All @@ -100,7 +100,7 @@ const statementHeader = (statement: Reconciliation, details: boolean, setShowDet
};

//-----------------------------------------------------------------
const statementBody = (statement: Reconciliation, details: boolean, styles: any) => {
const statementBody = (statement: Statement, details: boolean, styles: any) => {
const preAppBlkStr = statement.prevAppBlk === undefined ? '0' : statement.prevAppBlk.toString();
const rowStyle = styles.tableRow;
const detailView = !details ? <></> : (
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/Dashboard/Tabs/Details/components/Pills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/ui/views/Dashboard/Tabs/Details/components/ReconIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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,
} from '@modules/types';

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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -20,8 +20,8 @@ export const StatementDisplay = ({ record }: { record: Transaction}) => {
<div>
<table>
<tbody>
{(record.statements as unknown as Reconciliation[])?.map((statement, i) => (
<Statement
{(record.statements as unknown as Statement[])?.map((statement, i) => (
<StatementComponent
key={`statement.assetAddr + ${i.toString()}`}
statement={statement}
/>
Expand Down
1 change: 1 addition & 0 deletions src/ui/views/Dashboard/Tabs/Monitors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const Monitors = () => {
chain: chain.chain,
modes: ['monitors'],
verbose: true,
chains: true,
}), undefined, []) as CallStatus<Config[]>;
if (isFailedCall(monitorsCall)) {
createErrorNotification({
Expand Down
4 changes: 2 additions & 2 deletions src/ui/views/Explorer/Tabs/Blocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}));

Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/Names/Tabs/SubTabs/GenericSubTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function GenericSubTab({ filterFunc, resourceName }: GenericSubTabProps)
chain: chain.chain,
addrs: [],
known: true,
logLevel: 2,
// verbose: 2,
}));

return (
Expand Down
1 change: 1 addition & 0 deletions src/ui/views/Settings/Tabs/Indexes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const IndexesView = () => {
chain: chain.chain,
modes: ['index'],
verbose: true,
chains: true,
}));

const theGridData = useMemo(() => {
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit fc22417

Please sign in to comment.