Skip to content

Commit

Permalink
Merge branch 'feature/transactions-for-real-now' of https://github.co…
Browse files Browse the repository at this point in the history
…m/WardAnalytics/WardGraph into feature/transactions-for-real-now
  • Loading branch information
tubarao312 committed Feb 3, 2024
2 parents dac4808 + 68ef31b commit 7101a0d
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 128 deletions.
277 changes: 156 additions & 121 deletions src/api/transactions/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,146 +5,181 @@
* The ward's compliance queires endpoints
* OpenAPI spec version: 1.0
*/
import {
useQuery
} from 'react-query'
import type {
QueryFunction,
QueryKey,
UseQueryOptions,
UseQueryResult
} from 'react-query'
import type {
GetCombinedTransactions200
} from '../model/getCombinedTransactions200'
import type {
GetCombinedTransactionsParams
} from '../model/getCombinedTransactionsParams'
import type {
GetTransactionsBetweenAddresses200
} from '../model/getTransactionsBetweenAddresses200'
import type {
GetTransactionsBetweenAddressesParams
} from '../model/getTransactionsBetweenAddressesParams'
import { instance } from '.././instance';


UseQueryResult,
} from "react-query";
import type { GetCombinedTransactions200 } from "../model/getCombinedTransactions200";
import type { GetCombinedTransactionsParams } from "../model/getCombinedTransactionsParams";
import type { GetTransactionsBetweenAddresses200 } from "../model/getTransactionsBetweenAddresses200";
import type { GetTransactionsBetweenAddressesParams } from "../model/getTransactionsBetweenAddressesParams";

/**
* Get transactions between addresses
*/
export const getTransactionsBetweenAddresses = (
params: GetTransactionsBetweenAddressesParams,
signal?: AbortSignal
params: GetTransactionsBetweenAddressesParams,
signal?: AbortSignal,
) => {


return instance<GetTransactionsBetweenAddresses200>(
{url: `/transactions/get_transactions_between_addresses`, method: 'GET',
params, signal
},
);
}


export const getGetTransactionsBetweenAddressesQueryKey = (params: GetTransactionsBetweenAddressesParams,) => {
return [`/transactions/get_transactions_between_addresses`, ...(params ? [params]: [])] as const;
}


export const getGetTransactionsBetweenAddressesQueryOptions = <TData = Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>, TError = unknown>(params: GetTransactionsBetweenAddressesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>, TError, TData>, }
return instance<GetTransactionsBetweenAddresses200>({
url: `/transactions/get_transactions_between_addresses`,
method: "GET",
params,
signal,
});
};

export const getGetTransactionsBetweenAddressesQueryKey = (
params: GetTransactionsBetweenAddressesParams,
) => {

const {query: queryOptions} = options ?? {};

const queryKey = queryOptions?.queryKey ?? getGetTransactionsBetweenAddressesQueryKey(params);



const queryFn: QueryFunction<Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>> = ({ signal }) => getTransactionsBetweenAddresses(params, signal);





return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>, TError, TData> & { queryKey: QueryKey }
}

export type GetTransactionsBetweenAddressesQueryResult = NonNullable<Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>>
export type GetTransactionsBetweenAddressesQueryError = unknown

export const useGetTransactionsBetweenAddresses = <TData = Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>, TError = unknown>(
params: GetTransactionsBetweenAddressesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>, TError, TData>, }

): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {

const queryOptions = getGetTransactionsBetweenAddressesQueryOptions(params,options)

const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };

query.queryKey = queryOptions.queryKey ;
return [
`/transactions/get_transactions_between_addresses`,
...(params ? [params] : []),
] as const;
};

export const getGetTransactionsBetweenAddressesQueryOptions = <
TData = Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>,
TError = unknown,
>(
params: GetTransactionsBetweenAddressesParams,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>,
TError,
TData
>;
},
) => {
const { query: queryOptions } = options ?? {};

const queryKey =
queryOptions?.queryKey ??
getGetTransactionsBetweenAddressesQueryKey(params);

const queryFn: QueryFunction<
Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>
> = ({ signal }) => getTransactionsBetweenAddresses(params, signal);

return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>,
TError,
TData
> & { queryKey: QueryKey };
};

export type GetTransactionsBetweenAddressesQueryResult = NonNullable<
Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>
>;
export type GetTransactionsBetweenAddressesQueryError = unknown;

export const useGetTransactionsBetweenAddresses = <
TData = Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>,
TError = unknown,
>(
params: GetTransactionsBetweenAddressesParams,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getTransactionsBetweenAddresses>>,
TError,
TData
>;
},
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
const queryOptions = getGetTransactionsBetweenAddressesQueryOptions(
params,
options,
);

const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
queryKey: QueryKey;
};

query.queryKey = queryOptions.queryKey;

return query;
}


};

/**
* Get combined transactions
*/
export const getCombinedTransactions = (
params: GetCombinedTransactionsParams,
signal?: AbortSignal
params: GetCombinedTransactionsParams,
signal?: AbortSignal,
) => {


return instance<GetCombinedTransactions200>(
{url: `/transactions/get_combined_transactions`, method: 'GET',
params, signal
},
);
}


export const getGetCombinedTransactionsQueryKey = (params: GetCombinedTransactionsParams,) => {
return [`/transactions/get_combined_transactions`, ...(params ? [params]: [])] as const;
}


export const getGetCombinedTransactionsQueryOptions = <TData = Awaited<ReturnType<typeof getCombinedTransactions>>, TError = unknown>(params: GetCombinedTransactionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getCombinedTransactions>>, TError, TData>, }
return instance<GetCombinedTransactions200>({
url: `/transactions/get_combined_transactions`,
method: "GET",
params,
signal,
});
};

export const getGetCombinedTransactionsQueryKey = (
params: GetCombinedTransactionsParams,
) => {

const {query: queryOptions} = options ?? {};

const queryKey = queryOptions?.queryKey ?? getGetCombinedTransactionsQueryKey(params);



const queryFn: QueryFunction<Awaited<ReturnType<typeof getCombinedTransactions>>> = ({ signal }) => getCombinedTransactions(params, signal);





return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getCombinedTransactions>>, TError, TData> & { queryKey: QueryKey }
}

export type GetCombinedTransactionsQueryResult = NonNullable<Awaited<ReturnType<typeof getCombinedTransactions>>>
export type GetCombinedTransactionsQueryError = unknown

export const useGetCombinedTransactions = <TData = Awaited<ReturnType<typeof getCombinedTransactions>>, TError = unknown>(
params: GetCombinedTransactionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getCombinedTransactions>>, TError, TData>, }

): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {

const queryOptions = getGetCombinedTransactionsQueryOptions(params,options)

const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };

query.queryKey = queryOptions.queryKey ;
return [
`/transactions/get_combined_transactions`,
...(params ? [params] : []),
] as const;
};

export const getGetCombinedTransactionsQueryOptions = <
TData = Awaited<ReturnType<typeof getCombinedTransactions>>,
TError = unknown,
>(
params: GetCombinedTransactionsParams,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getCombinedTransactions>>,
TError,
TData
>;
},
) => {
const { query: queryOptions } = options ?? {};

const queryKey =
queryOptions?.queryKey ?? getGetCombinedTransactionsQueryKey(params);

const queryFn: QueryFunction<
Awaited<ReturnType<typeof getCombinedTransactions>>
> = ({ signal }) => getCombinedTransactions(params, signal);

return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getCombinedTransactions>>,
TError,
TData
> & { queryKey: QueryKey };
};

export type GetCombinedTransactionsQueryResult = NonNullable<
Awaited<ReturnType<typeof getCombinedTransactions>>
>;
export type GetCombinedTransactionsQueryError = unknown;

export const useGetCombinedTransactions = <
TData = Awaited<ReturnType<typeof getCombinedTransactions>>,
TError = unknown,
>(
params: GetCombinedTransactionsParams,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getCombinedTransactions>>,
TError,
TData
>;
},
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
const queryOptions = getGetCombinedTransactionsQueryOptions(params, options);

const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
queryKey: QueryKey;
};

query.queryKey = queryOptions.queryKey;

return query;
}



};
12 changes: 6 additions & 6 deletions src/components/Graph/AnalysisWindow/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { FC, useContext } from "react";
import clsx from "clsx";
import { XMarkIcon } from "@heroicons/react/20/solid";
import clsx from "clsx";
import { FC, useContext } from "react";

import LabelList from "./components/LabelList";
import CopyToClipboardIcon from "./components/CopyToClipboardIcon";
import BlockExplorerAddressIcon from "./components/BlockExplorerAddressIcon";
import RiskIndicator from "./components/RiskIndicator";
import BigButton from "../../../common/BigButton";
import EntityLogo from "../../../common/EntityLogo";
import BlockExplorerAddressIcon from "./components/BlockExplorerAddressIcon";
import CopyToClipboardIcon from "./components/CopyToClipboardIcon";
import LabelList from "./components/LabelList";
import RiskIndicator from "./components/RiskIndicator";

import { AnalysisContext } from "../AnalysisWindow";
import { AnalysisMode, AnalysisModes } from "../AnalysisWindow";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import {
BarsArrowDownIcon,
ArrowDownLeftIcon,
ArrowUpRightIcon,
BarsArrowDownIcon,
} from "@heroicons/react/16/solid";
import { Transition } from "@headlessui/react";
import { FC, useContext } from "react";

import { Colors } from "../../../../utils/colors";
import formatNumber from "../../../../utils/formatNumber";
Expand Down

0 comments on commit 7101a0d

Please sign in to comment.