Skip to content
This repository has been archived by the owner on Feb 2, 2025. It is now read-only.

Commit

Permalink
Latest
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Dec 16, 2022
1 parent 248723d commit d2d9297
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 14 deletions.
28 changes: 28 additions & 0 deletions src/sdk/generated_ts/paths/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as ApiCallers from "../lib/api_callers";
import { Status } from "../types";

export function getConfig(
parameters?: {
modes?: string[],
module?: string[],
details?: boolean,
terse?: boolean,
chain: string,
noHeader?: boolean,
fmt?: string,
verbose?: boolean,
logLevel?: number,
wei?: boolean,
ether?: boolean,
dollars?: boolean,
raw?: boolean,
toFile?: boolean,
},
options?: RequestInit,
) {
return ApiCallers.fetch<Status[]>(
{
endpoint: '/config', method: 'get', parameters, options,
},
);
}
2 changes: 1 addition & 1 deletion src/sdk/generated_ts/paths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export * from './traces';
export * from './when';
export * from './state';
export * from './tokens';
export * from './status';
export * from './config';
export * from './scrape';
export * from './chunks';
export * from './init';
Expand Down
1 change: 1 addition & 0 deletions src/sdk/generated_ts/paths/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function getList(
count?: boolean,
appearances?: boolean,
silent?: boolean,
noZero?: boolean,
firstRecord?: number,
maxRecords?: number,
firstBlock?: number,
Expand Down
6 changes: 3 additions & 3 deletions src/sdk/generated_ts/paths/status.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ApiCallers from "../lib/api_callers";
import { Status } from "../types";
import * as ApiCallers from '../lib/api_callers';
import { Status } from '../types';

export function getStatus(
export function getConfig(
parameters?: {
modes?: string[],
details?: boolean,
Expand Down
25 changes: 25 additions & 0 deletions src/sdk/generated_ts/types/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {
Cache, Chain, Key, timestamp,
} from '.';

export type Config = {
clientVersion: string
clientIds: string
trueblocksVersion: string
rpcProvider: string
configPath: string
cachePath: string
indexPath: string
host: string
isTesting: boolean
isApi: boolean
isScraping: boolean
isArchive: boolean
isTracing: boolean
hasEskey: boolean
hasPinkey: boolean
ts: timestamp
chains: Chain[]
caches: Cache[]
keys?: Key[]
}
3 changes: 2 additions & 1 deletion src/sdk/generated_ts/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ export * from './traceAction'
export * from './traceResult'
export * from './datedBlock'
export * from './state'
export * from './result'
export * from './transfer'
export * from './result'
export * from './token'
export * from './status'
export * from './cache'
export * from './pinnedChunk'
export * from './manifest'
export * from './chain'
export * from './key'
export * from './cacheEntry'
export * from './function'
export * from './parameter'
8 changes: 8 additions & 0 deletions src/sdk/generated_ts/types/key.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import "../types";

export type Key = {
provider: string
apiKey: string
jwt: string
secret: string
}
5 changes: 4 additions & 1 deletion src/sdk/generated_ts/types/status.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { timestamp, Chain, Cache } from "../types";
import {
Cache, Chain, Key, timestamp,
} from '.';

export type Status = {
clientVersion: string
Expand All @@ -19,4 +21,5 @@ export type Status = {
ts: timestamp
chains: Chain[]
caches: Cache[]
keys?: Key[]
}
5 changes: 3 additions & 2 deletions src/ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@ant-design/icons';
import {
Chain,
getStatus, Status, SuccessResponse,
getConfig, Status, SuccessResponse,
} from '@sdk';
import {
Layout,
Expand Down Expand Up @@ -95,7 +95,8 @@ export const App = () => {

useEffect(() => {
const fetchStatus = async () => {
const statusResponse = wrapResponse(await getStatus({
const statusResponse = wrapResponse(await getConfig({
modes: ['show'],
chain: chain.chain,
fmt: 'json',
}));
Expand Down
7 changes: 4 additions & 3 deletions src/ui/views/Dashboard/Tabs/Monitors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, {

import { PlusCircleFilled, SearchOutlined } from '@ant-design/icons';
import {
Chain, getStatus, Monitor, Status,
Chain, getConfig, Monitor, Status,
} from '@sdk';
import {
Button, Input,
Expand Down Expand Up @@ -39,9 +39,10 @@ export const Monitors = () => {
const [selectedNameTags] = useState('');
const [loadingEdit, setLoadingEdit] = useState(false);

const monitorsCall = useSdk(() => getStatus({
const monitorsCall = useSdk(() => getConfig({
chain: chain.chain,
modes: ['monitors'],
modes: ['show'],
module: ['monitors'],
details: true,
}), undefined, []) as CallStatus<Status[]>;
if (isFailedCall(monitorsCall)) {
Expand Down
7 changes: 4 additions & 3 deletions src/ui/views/Settings/Tabs/Indexes.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useMemo } from 'react';

import { getStatus, PinnedChunk } from '@sdk';
import { getConfig, PinnedChunk } from '@sdk';
import { ColumnsType } from 'antd/lib/table';

import { BaseView } from '@components/BaseView';
Expand All @@ -26,9 +26,10 @@ import { IndexTable } from './SubTabs/IndexTable';

export const IndexesView = () => {
const { chain } = useGlobalState();
const statusCall = useSdk(() => getStatus({
const statusCall = useSdk(() => getConfig({
chain: chain.chain,
modes: ['index'],
modes: ['show'],
module: ['index'],
details: true,
}));

Expand Down

0 comments on commit d2d9297

Please sign in to comment.