Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API #97

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/api/compliance/compliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import type {
UseQueryResult
} from 'react-query'
import type {
AddressAnalysis
} from '../model/addressAnalysis'
AnalysisAddressData200
} from '../model/analysisAddressData200'
import type {
ErrorResponse
} from '../model/errorResponse'
Expand All @@ -33,7 +33,7 @@ export const analysisAddressData = (
) => {


return instance<AddressAnalysis>(
return instance<AnalysisAddressData200>(
{url: `/addresses/${address}`, method: 'GET', signal
},
);
Expand Down
12 changes: 12 additions & 0 deletions src/api/model/analysisAddressData200.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Generated by orval v6.23.0 🍺
* Do not edit manually.
* compliance-queries-api
* The ward's compliance queires endpoints
* OpenAPI spec version: 1.0
*/
import type { AddressAnalysis } from './addressAnalysis';

export type AnalysisAddressData200 = {
data?: AddressAnalysis;
};
9 changes: 9 additions & 0 deletions src/api/model/analysisAddressData200Data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Generated by orval v6.23.0 🍺
* Do not edit manually.
* compliance-queries-api
* The ward's compliance queires endpoints
* OpenAPI spec version: 1.0
*/

export type AnalysisAddressData200Data = { [key: string]: any };
4 changes: 2 additions & 2 deletions src/api/model/getTransactions200.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* The ward's compliance queires endpoints
* OpenAPI spec version: 1.0
*/
import type { Transaction } from './transaction';
import type { GetTransactions200Data } from './getTransactions200Data';

export type GetTransactions200 = {
transactions?: Transaction[];
data?: GetTransactions200Data;
};
15 changes: 15 additions & 0 deletions src/api/model/getTransactions200Data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Generated by orval v6.23.0 🍺
* Do not edit manually.
* compliance-queries-api
* The ward's compliance queires endpoints
* OpenAPI spec version: 1.0
*/
import type { Transaction } from './transaction';

export type GetTransactions200Data = {
page?: number;
page_size?: number;
total?: number;
transactions?: Transaction[];
};
3 changes: 3 additions & 0 deletions src/api/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

export * from './address';
export * from './addressAnalysis';
export * from './analysisAddressData200';
export * from './analysisAddressData200Data';
export * from './analysisAddressDataParams';
export * from './category';
export * from './entity';
Expand All @@ -19,6 +21,7 @@ export * from './getCombinedTransactionsTransactionType';
export * from './getTokenMetadata200';
export * from './getTokenMetadataBody';
export * from './getTransactions200';
export * from './getTransactions200Data';
export * from './getTransactionsBetweenAddresses200';
export * from './getTransactionsBetweenAddressesParams';
export * from './getTransactionsParams';
Expand Down
24 changes: 17 additions & 7 deletions src/api/ward-analytics-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/AddressAnalysis"
type: object
properties:
data:
$ref: "#/components/schemas/AddressAnalysis"
"400":
description: Bad Request
content:
Expand Down Expand Up @@ -113,12 +116,19 @@ paths:
schema:
type: object
properties:
transactions:
type: array
items:
$ref: "#/components/schemas/Transaction"
required:
- transactions
data:
type: object
properties:
transactions:
type: array
items:
$ref: "#/components/schemas/Transaction"
total:
type: integer
page:
type: integer
page_size:
type: integer
/labels/search-labels:
post:
operationId: search-labels
Expand Down
3 changes: 2 additions & 1 deletion src/components/graph/TransactionsBetweenAddressesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ const TransactionsBetweenAddressesDialog: FC<
retry: true,
cacheTime: 1000, // 1 second
staleTime: 1000, // 1 second
onSuccess: (data) => {
onSuccess: (rawData) => {
const data = rawData.data!;
const transactions: Transaction[] = data.transactions!;

const newTransactionRows: TransactionRowProps[] = transactions.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ const Transactions: FC = () => {
retry: true,
cacheTime: 1000, // 1 second
staleTime: 1000, // 1 second
onSuccess: (data) => {
onSuccess: (rawData) => {
const data = rawData.data!;
// Only get the first TRANSACTIONS_INTERVAL transactions
const transactions: Transaction[] = data.transactions!.slice(
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ const AddressNode: FC<AddressNodeProps> = ({
cacheTime: 1000, // 1 second
staleTime: 1000, // 1 second

onSuccess: (data) => {
onSuccess: (rawData) => {
const data = rawData.data!;
setAnalysisData(data);
registerAddressRisk(address, data.risk);

Expand Down
Loading