Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
boyan01 committed Nov 7, 2023
1 parent bb82f6c commit 3d3b6ec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 32 deletions.
39 changes: 17 additions & 22 deletions src/client/token.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { buildClient } from './utils';
import { AxiosInstance } from 'axios';
import { buildClient } from './utils';
import { PendingDeposit, SafeSnapshot, Token } from './types/token';

export const TokenKeystoreClient = (axiosInstance: AxiosInstance) => ({
assets: (): Promise<Token[]> => axiosInstance.get<unknown, Token[]>('/safe/assets'),
assetsById: (id: string): Promise<Token> => axiosInstance.get<unknown, Token>(`/safe/assets/${id}`),
queryAssets: (query: string): Promise<Token[]> => axiosInstance.get<unknown, Token[]>(`/network/assets/search/${query}`),
fetchAssets: (assetIds: string[]): Promise<Token[]> => axiosInstance.post<unknown, Token[]>(`/safe/assets/fetch`, assetIds),
topAssets: (kind: String = 'normal'): Promise<Token[]> =>
axiosInstance.get<unknown, Token[]>('/network/assets/top', {
params: {
kind: kind,
},
}),
topAssets: (kind: String = 'normal'): Promise<Token[]> => axiosInstance.get<unknown, Token[]>('/network/assets/top', { params: { kind } }),
snapshots: (
assetId: string,
offset: string | null = null,
Expand All @@ -23,37 +18,37 @@ export const TokenKeystoreClient = (axiosInstance: AxiosInstance) => ({
): Promise<SafeSnapshot[]> =>
axiosInstance.get<unknown, SafeSnapshot[]>(`/safe/snapshots`, {
params: {
asset: assetId,
offset: offset,
limit: limit,
opponent: opponent,
destination: destination,
tag: tag,
assetId,
offset,
limit,
opponent,
destination,
tag,
},
}),
snapshotByAssetId: (asset: string, offset: String | null = null, limit: number = 30): Promise<SafeSnapshot[]> =>
axiosInstance.get<unknown, SafeSnapshot[]>(`/safe/snapshots`, {
params: {
asset: asset,
offset: offset,
limit: limit,
asset,
offset,
limit,
},
}),
allSnapshots: (offset: string | null = null, limit: number = 30, opponent: string | null = null): Promise<SafeSnapshot[]> =>
axiosInstance.get<unknown, SafeSnapshot[]>(`/safe/snapshots`, {
params: {
offset: offset,
limit: limit,
opponent: opponent,
offset,
limit,
opponent,
},
}),
snapshotById: (id: string): Promise<SafeSnapshot> => axiosInstance.get<unknown, SafeSnapshot>(`/safe/snapshots/${id}`),
pendingDeposits: (asset: string, destination: string | null = null, tag: string | null = null): Promise<PendingDeposit[]> =>
axiosInstance.get<unknown, PendingDeposit[]>(`/safe/deposits`, {
params: {
asset: asset,
destination: destination,
tag: tag,
asset,
destination,
tag,
},
}),
});
Expand Down
19 changes: 9 additions & 10 deletions src/client/utxo.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { AxiosInstance } from 'axios';
import { buildClient } from './utils';
import {
UtxoOutput,
OutputRequest,
DepositEntryRequest,
AssetResponse,
Deposit,
SafeRegisterRequest,
RegisterResponse,
GhostKeyRequest,
DepositEntryRequest,
GhostKey,
GhostKeyRequest,
OutputFetchRequest,
OutputRequest,
RegisterResponse,
SafeRegisterRequest,
TransactionRequest,
TransactionResponse,
OutputFetchRequest,
UtxoOutput,
} from './types';
import { hashMembers } from './utils';
import { AssetResponse } from './types';
import { buildClient, hashMembers } from './utils';

export const UtxoKeystoreClient = (axiosInstance: AxiosInstance) => ({
fetchList: (params: OutputRequest): Promise<UtxoOutput[]> =>
Expand Down

0 comments on commit 3d3b6ec

Please sign in to comment.