Skip to content

Commit

Permalink
Merge pull request #287 from TrueBlocks/develop
Browse files Browse the repository at this point in the history
Update to use version v0.44.0 of trueblocks-core
  • Loading branch information
tjayrush authored Nov 25, 2022
2 parents 250f295 + f4b398e commit 887ce90
Show file tree
Hide file tree
Showing 18 changed files with 82 additions and 44 deletions.
6 changes: 3 additions & 3 deletions src/sdk/generated_ts/paths/export.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as ApiCallers from "../lib/api_callers";
import { address, topic, fourbyte, Appearance, Reconciliation, ListStats, Transaction, Receipt, Log, Trace } from "../types";
import { address, topic, fourbyte, Appearance, Reconciliation, ListStats, Transaction, Receipt, Log, Trace, Transfer } from "../types";

export function getExport(
parameters?: {
Expand All @@ -10,9 +10,9 @@ export function getExport(
receipts?: boolean,
logs?: boolean,
traces?: boolean,
statements?: boolean,
neighbors?: boolean,
accounting?: boolean,
statements?: boolean,
articulate?: boolean,
cache?: boolean,
cacheTraces?: boolean,
Expand Down Expand Up @@ -40,7 +40,7 @@ export function getExport(
},
options?: RequestInit,
) {
return ApiCallers.fetch<Appearance[] | Reconciliation[] | ListStats[] | Transaction[] | Receipt[] | Log[] | Trace[]>(
return ApiCallers.fetch<Appearance[] | Reconciliation[] | ListStats[] | Transaction[] | Receipt[] | Log[] | Trace[] | Transfer[]>(
{
endpoint: '/export', method: 'get', parameters, options,
},
Expand Down
4 changes: 4 additions & 0 deletions src/sdk/generated_ts/paths/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export function getList(
count?: boolean,
appearances?: boolean,
silent?: boolean,
firstRecord?: number,
maxRecords?: number,
firstBlock?: number,
lastBlock?: number,
chain: string,
noHeader?: boolean,
fmt?: string,
Expand Down
1 change: 1 addition & 0 deletions src/sdk/generated_ts/paths/monitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function getMonitors(
parameters?: {
addrs?: address[],
clean?: boolean,
list?: boolean,
watch?: boolean,
sleep?: number,
delete?: boolean,
Expand Down
6 changes: 3 additions & 3 deletions src/sdk/generated_ts/paths/transactions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as ApiCallers from "../lib/api_callers";
import { tx_id, Transaction } from "../types";
import { tx_id, Transaction, Transfer } from "../types";

export function getTransactions(
parameters?: {
Expand All @@ -8,7 +8,7 @@ export function getTransactions(
trace?: boolean,
uniq?: boolean,
flow?: 'from' | 'to',
reconcile?: string,
accountFor?: string,
cache?: boolean,
chain: string,
noHeader?: boolean,
Expand All @@ -23,7 +23,7 @@ export function getTransactions(
},
options?: RequestInit,
) {
return ApiCallers.fetch<Transaction[]>(
return ApiCallers.fetch<Transaction[] | Transfer[]>(
{
endpoint: '/transactions', method: 'get', parameters, options,
},
Expand Down
3 changes: 3 additions & 0 deletions src/sdk/generated_ts/paths/when.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export function getWhen(
blocks?: string[],
list?: boolean,
timestamps?: boolean,
count?: boolean,
repair?: boolean,
check?: boolean,
chain: string,
noHeader?: boolean,
fmt?: string,
Expand Down
1 change: 1 addition & 0 deletions src/sdk/generated_ts/types/base_types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type hash = string;
export type blknum = number;
export type date = string;
export type Datetime = string;
export type address = string;
export type timestamp = number;
export type wei = string;
Expand Down
1 change: 1 addition & 0 deletions src/sdk/generated_ts/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from './traceResult'
export * from './datedBlock'
export * from './state'
export * from './result'
export * from './transfer'
export * from './token'
export * from './status'
export * from './cache'
Expand Down
40 changes: 24 additions & 16 deletions src/sdk/generated_ts/types/reconciliation.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
import { blknum, timestamp, address, uint64, int256, double } from "../types";
import { blknum, hash, timestamp, Datetime, address, uint64, double, int256 } from "../types";

export type Reconciliation = {
blockNumber: blknum
transactionIndex: blknum
logIndex: blknum
transactionHash: hash
timestamp: timestamp
date: Datetime
assetAddr: address
assetSymbol: string
decimals: uint64
prevBlk: blknum
prevBlkBal: int256
spotPrice: double
priceSource: string
accountedFor: address
sender: address
recipient: address
begBal: int256
begBalDiff: int256
amountNet: int256
endBal: int256
encoding: string
signature: string
reconciliationType: string
reconciled: boolean
totalIn: int256
amountIn: int256
amountOut: int256
internalIn: int256
internalOut: int256
selfDestructIn: int256
selfDestructOut: int256
minerBaseRewardIn: int256
minerNephewRewardIn: int256
minerTxFeeIn: int256
minerUncleRewardIn: int256
prefundIn: int256
spotPrice: double
priceSource: string
gasCostOut: int256
endBal: int256
totalIn: int256
totalOut: int256
amountOut: int256
internalOut: int256
selfDestructOut: int256
gasOut: int256
totalOutLessGas: int256
amountNet: int256
endBalCalc: int256
reconciliationType: string
prevAppBlk: blknum
prevBal: int256
begBalDiff: int256
endBalDiff: int256
reconciled: boolean
endBalCalc: int256
}
6 changes: 3 additions & 3 deletions src/sdk/generated_ts/types/state.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { blknum, wei, uint64, bytes, address } from "../types";
import { blknum, address, wei, uint64, bytes } from "../types";

export type State = {
blockNumber: blknum
address: address
proxy: address
balance: wei
nonce: uint64
code: bytes
storage: bytes
address: address
deployed: blknum
accttype: string
}
4 changes: 2 additions & 2 deletions src/sdk/generated_ts/types/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { gas, hash, blknum, uint64, timestamp, address, wei, bytes, Receipt, Reconciliation, Function, date } from "../types";
import { hash, blknum, uint64, timestamp, address, wei, gas, bytes, Receipt, Reconciliation, Function, date } from "../types";

export type Transaction = {
gasPrice: gas
hash: hash
blockHash: hash
blockNumber: blknum
Expand All @@ -12,6 +11,7 @@ export type Transaction = {
to: address
value: wei
gas: gas
gasPrice: gas
input: bytes
receipt: Receipt
statements: Reconciliation[]
Expand Down
19 changes: 19 additions & 0 deletions src/sdk/generated_ts/types/transfer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { blknum, hash, timestamp, Datetime, address, uint64, uint256, double } from "../types";

export type Transfer = {
blockNumber: blknum
transactionIndex: blknum
logIndex: blknum
transactionHash: hash
timestamp: timestamp
date: Datetime
sender: address
recipient: address
assetAddr: address
assetSymbol: string
decimals: uint64
amount: uint256
spotPrice: double
priceSource: string
encoding: string
}
1 change: 1 addition & 0 deletions src/sdk/input/base_types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type hash = string;
export type blknum = number;
export type date = string;
export type Datetime = string;
export type address = string;
export type timestamp = number;
export type wei = string;
Expand Down
6 changes: 3 additions & 3 deletions src/ui/datastore/worker/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function fetchTransactions(chain: string, addresses: Address[], loaded: nu
// reversed: false,
relevant: true,
// summarize_by: 'monthly',
firstRecord: loaded,
firstRecord: loaded + 1,
maxRecords: (() => {
if (loaded < 20) return 10;
if (loaded < 800) return 239;
Expand Down Expand Up @@ -286,7 +286,7 @@ export const getGas = (transactions: Transaction[] | undefined, getNameFor: (add

const usesGas = transactions.filter((tx) => {
if (!tx.statements) return false;
const stmts = tx.statements.filter((st) => st.gasCostOut);
const stmts = tx.statements.filter((st) => st.gasOut);
return stmts.length > 0;
});

Expand All @@ -301,7 +301,7 @@ export const getGas = (transactions: Transaction[] | undefined, getNameFor: (add
toName: getNameFor(tx.to),
isError: tx.isError,
asset: st.assetSymbol,
gasCostOut: st.gasCostOut,
gasOut: st.gasOut,
})));
};

Expand Down
12 changes: 6 additions & 6 deletions src/ui/modules/filters/sample_transactions.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@
"assetAddr": "0xf503017d7baf7fbc0fff7492b751025c6a78179b",
"assetSymbol": "ETH",
"decimals": 18,
"prevBlk": 12734166,
"prevBlkBal": 36.892758101192445316,
"prevAppBlk": 12734166,
"prevBal": 36.892758101192445316,
"begBal": 36.892758101192445316,
"endBal": 36.892758101192445316,
"amountIn": 0,
Expand All @@ -268,7 +268,7 @@
"amountOut": 0,
"internalOut": 0,
"selfDestructOut": 0,
"gasCostOut": 0,
"gasOut": 0,
"reconciliationType": "regular",
"spotPrice": 2157.84170,
"priceSource": "uniswap",
Expand All @@ -288,8 +288,8 @@
"assetAddr": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"assetSymbol": "USDT",
"decimals": 6,
"prevBlk": 12734167,
"prevBlkBal": 57.816500000000000000,
"prevAppBlk": 12734167,
"prevBal": 57.816500000000000000,
"begBal": 57.816500000000000000,
"endBal": 72.816500000000000000,
"amountIn": 15.0000000,
Expand All @@ -303,7 +303,7 @@
"amountOut": 0,
"internalOut": 0,
"selfDestructOut": 0,
"gasCostOut": 0,
"gasOut": 0,
"reconciliationType": "regular",
"spotPrice": 1.00000,
"priceSource": "stable-coin",
Expand Down
6 changes: 3 additions & 3 deletions src/ui/modules/types/Reconciliation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const priceReconciliation = (statementIn: Reconciliation, denom: string)

const statement: Reconciliation = JSON.parse(JSON.stringify(statementIn));
const properties: Array<keyof Reconciliation> = [
'prevBlkBal',
'prevBal',
'begBal',
'begBalDiff',
'amountIn',
Expand All @@ -20,8 +20,8 @@ export const priceReconciliation = (statementIn: Reconciliation, denom: string)
'minerTxFeeIn',
'minerUncleRewardIn',
'prefundIn',
'gasCostOut',
'gasCostOut',
'gasOut',
'gasOut',
'endBal',
'endBalCalc',
'endBalDiff',
Expand Down
6 changes: 3 additions & 3 deletions src/ui/views/Dashboard/Tabs/Details/SubTabs/HistoryRecons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ const statementBody = (statement: Reconciliation, details: boolean, styles: any)
{DividerRow(rowStyle)}
{DetailRow(rowStyle, 'assetSymbol', statement.assetSymbol)}
{DetailRow(rowStyle, 'decimals', statement.decimals)}
{DetailRow(rowStyle, 'prevBlk', statement.prevBlk.toString())}
{DetailRow(rowStyle, 'prevAppBlk', statement.prevAppBlk.toString())}
{DetailRow(rowStyle, 'blockNumber', statement.blockNumber.toString())}
{DetailRow(rowStyle, 'transactionIndex', statement.transactionIndex.toString())}
{DetailRow(rowStyle, 'timestamp', statement.timestamp.toString())}

{DividerRow(rowStyle)}
{DetailRow(rowStyle, 'type', statement.reconciliationType)}
{DetailRow(rowStyle, 'prevBlkBal', statement.prevBlkBal)}
{DetailRow(rowStyle, 'prevBal', statement.prevBal)}
{DetailRow(rowStyle, 'begBal', statement.begBal)}
{DetailRow(rowStyle, 'begBalDiff', statement.begBalDiff)}
{DetailRow(rowStyle, 'endBal', statement.endBal)}
Expand Down Expand Up @@ -146,7 +146,7 @@ const statementBody = (statement: Reconciliation, details: boolean, styles: any)
{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.gasCostOut))}
{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))}
{detailView}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const incomeFields = [
];

//-------------------------------------------------------------------------
export const outflowFields = ['amountOut', 'internalOut', 'selfDestructOut', 'gasCostOut'];
export const outflowFields = ['amountOut', 'internalOut', 'selfDestructOut', 'gasOut'];

//-------------------------------------------------------------------------
export const convertToText = (theData: Transaction[], delim: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const Statement = ({ statement }: { statement: Reconciliation }) => {
{showValue(pricedRecon.totalOutLessGas.toString())}
</td>
<td key={`${k}-5`} className={style.col} style={{ width: '17%' }}>
{showValue(pricedRecon.gasCostOut.toString(), false, true)}
{showValue(pricedRecon.gasOut.toString(), false, true)}
</td>
<td key={`${k}-6`} className={style.col} style={{ width: '17%' }}>
{showValue(pricedRecon.endBal.toString(), true)}
Expand Down

0 comments on commit 887ce90

Please sign in to comment.