diff --git a/.changeset/proud-cycles-sit.md b/.changeset/proud-cycles-sit.md new file mode 100644 index 0000000000..cc1469680f --- /dev/null +++ b/.changeset/proud-cycles-sit.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Adding new Profitability endpoints to the SDK diff --git a/demos/cli/src/main.ts b/demos/cli/src/main.ts index 82a5e6218c..905b5c7abb 100644 --- a/demos/cli/src/main.ts +++ b/demos/cli/src/main.ts @@ -62,6 +62,27 @@ async function main() { protocol: 'uniswap-v2', }); console.log('defiProtocolPositions', defiProtocolPositions.result.toJSON().positions); + + const walletProfitabilitySummary = await Moralis.EvmApi.wallets.getWalletProfitabilitySummary({ + address: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', + days: 'all', + chain: '0x1', + }); + console.log('walletProfitabilitySummary', walletProfitabilitySummary.result.toJSON()); + + const walletProfitability = await Moralis.EvmApi.wallets.getWalletProfitability({ + address: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', + days: 'all', + chain: '0x1', + }); + console.log('walletProfitability', walletProfitability.result.toJSON()); + + const topProfitableWalletPerToken = await Moralis.EvmApi.token.getTopProfitableWalletPerToken({ + address: '0x4a220e6096b25eadb88358cb44068a3248254675', + days: 'all', + chain: '0x1', + }); + console.log('topProfitableWalletPerToken', topProfitableWalletPerToken.result.toJSON()); } main(); diff --git a/packages/common/evmUtils/generator.config.json b/packages/common/evmUtils/generator.config.json index eafb1d2369..3cc3d0c72c 100644 --- a/packages/common/evmUtils/generator.config.json +++ b/packages/common/evmUtils/generator.config.json @@ -124,7 +124,10 @@ "getTokenOwners", "getDefiSummary", "getDefiPositionsByProtocol", - "getDefiPositionsSummary" + "getDefiPositionsSummary", + "getWalletProfitabilitySummary", + "getWalletProfitability", + "getTopProfitableWalletPerToken" ] } } diff --git a/packages/common/evmUtils/src/generated/client/abstractClient.ts b/packages/common/evmUtils/src/generated/client/abstractClient.ts index 87b472da3d..ab01ead21c 100644 --- a/packages/common/evmUtils/src/generated/client/abstractClient.ts +++ b/packages/common/evmUtils/src/generated/client/abstractClient.ts @@ -54,6 +54,12 @@ import { GetTokenStatsOperation, GetTokenStatsOperationRequest, GetTokenStatsOpe import { EvmErc20TokenStat, EvmErc20TokenStatJSON } from '../types/EvmErc20TokenStat'; import { GetBlockStatsOperation, GetBlockStatsOperationRequest, GetBlockStatsOperationRequestJSON } from '../operations/GetBlockStatsOperation'; import { EvmBlockTokenStat, EvmBlockTokenStatJSON } from '../types/EvmBlockTokenStat'; +import { GetWalletProfitabilitySummaryOperation, GetWalletProfitabilitySummaryOperationRequest, GetWalletProfitabilitySummaryOperationRequestJSON } from '../operations/GetWalletProfitabilitySummaryOperation'; +import { EvmGetWalletProfitabilitySummary, EvmGetWalletProfitabilitySummaryJSON } from '../types/EvmGetWalletProfitabilitySummary'; +import { GetWalletProfitabilityOperation, GetWalletProfitabilityOperationRequest, GetWalletProfitabilityOperationRequestJSON } from '../operations/GetWalletProfitabilityOperation'; +import { EvmWalletProfitabilityResponse, EvmWalletProfitabilityResponseJSON } from '../types/EvmWalletProfitabilityResponse'; +import { GetTopProfitableWalletPerTokenOperation, GetTopProfitableWalletPerTokenOperationRequest, GetTopProfitableWalletPerTokenOperationRequestJSON } from '../operations/GetTopProfitableWalletPerTokenOperation'; +import { EvmWalletTopProfitableWalletPerTokenResponse, EvmWalletTopProfitableWalletPerTokenResponseJSON } from '../types/EvmWalletTopProfitableWalletPerTokenResponse'; export interface OperationV3 { operationId: string; @@ -329,6 +335,20 @@ export abstract class AbstractClient { EvmErc20TokenStat, EvmErc20TokenStatJSON >(GetTokenStatsOperation), + /** + * @description Retrieves a list of the top profitable wallets for a specific ERC20 token. + * @param request Request with parameters. + * @param {Object} request.address The ERC20 token address. + * @param {String} [request.days] Timeframe in days for which profitability is calculated, can be 'all', '7d' or '30d' (optional) + * @param {Object} [request.chain] The chain to query (optional) + * @returns {Object} Response for the request. + */ + getTopProfitableWalletPerToken: this.createEndpoint< + GetTopProfitableWalletPerTokenOperationRequest, + GetTopProfitableWalletPerTokenOperationRequestJSON, + EvmWalletTopProfitableWalletPerTokenResponse, + EvmWalletTopProfitableWalletPerTokenResponseJSON + >(GetTopProfitableWalletPerTokenOperation), }; public readonly utils = { /** @@ -504,5 +524,34 @@ export abstract class AbstractClient { EvmWalletStat, EvmWalletStatJSON >(GetWalletStatsOperation), + /** + * @description Retrieves a summary of wallet profitability based on specified parameters including optional token addresses. + * @param request Request with parameters. + * @param {Object} request.address The wallet address for which profitability summary is to be retrieved. + * @param {String} [request.days] Timeframe in days for the profitability summary. Options include 'all', '7', '30', '60', '90' default is 'all'. (optional) + * @param {Object} [request.chain] The chain to query (optional) + * @returns {Object} Response for the request. + */ + getWalletProfitabilitySummary: this.createEndpoint< + GetWalletProfitabilitySummaryOperationRequest, + GetWalletProfitabilitySummaryOperationRequestJSON, + EvmGetWalletProfitabilitySummary, + EvmGetWalletProfitabilitySummaryJSON + >(GetWalletProfitabilitySummaryOperation), + /** + * @description Retrieves profitability information for a specific wallet address. Can be filtered by one or more tokens. + * @param request Request with parameters. + * @param {Object} request.address The wallet address for which profitability is to be retrieved. + * @param {String} [request.days] Timeframe in days for which profitability is calculated, Options include 'all', '7', '30', '60', '90' default is 'all'. (optional) + * @param {Object} [request.chain] The chain to query (optional) + * @param {Object[]} [request.tokenAddresses] The token addresses list to filter the result with (optional) + * @returns {Object} Response for the request. + */ + getWalletProfitability: this.createEndpoint< + GetWalletProfitabilityOperationRequest, + GetWalletProfitabilityOperationRequestJSON, + EvmWalletProfitabilityResponse, + EvmWalletProfitabilityResponseJSON + >(GetWalletProfitabilityOperation), }; } diff --git a/packages/common/evmUtils/src/generated/operations/GetTopProfitableWalletPerTokenOperation.ts b/packages/common/evmUtils/src/generated/operations/GetTopProfitableWalletPerTokenOperation.ts new file mode 100644 index 0000000000..aae4a44908 --- /dev/null +++ b/packages/common/evmUtils/src/generated/operations/GetTopProfitableWalletPerTokenOperation.ts @@ -0,0 +1,57 @@ +import { EvmAddress, EvmAddressInput, EvmAddressJSON, EvmChain, EvmChainInput, EvmChainJSON } from '../../dataTypes'; +import { EvmWalletTopProfitableWalletPerTokenResponse, EvmWalletTopProfitableWalletPerTokenResponseJSON } from '../types/EvmWalletTopProfitableWalletPerTokenResponse'; + +// request parameters: +// - address ($ref: #/paths/~1erc20~1{address}~1top-gainers/get/parameters/0/schema) +// - days ($ref: #/paths/~1erc20~1{address}~1top-gainers/get/parameters/1/schema) +// - chain ($ref: #/components/schemas/discoveryApiChainsList) + +export interface GetTopProfitableWalletPerTokenOperationRequest { + /** + * @description The ERC20 token address. + */ + readonly address: EvmAddressInput | EvmAddress; + /** + * @description Timeframe in days for which profitability is calculated, can be 'all', '7d' or '30d' + */ + readonly days?: string; + /** + * @description The chain to query + */ + readonly chain?: EvmChainInput | EvmChain; +} + +export interface GetTopProfitableWalletPerTokenOperationRequestJSON { + readonly address: EvmAddressJSON; + readonly days?: string; + readonly chain?: EvmChainJSON; +} + +export type GetTopProfitableWalletPerTokenOperationResponse = EvmWalletTopProfitableWalletPerTokenResponse; +export type GetTopProfitableWalletPerTokenOperationResponseJSON = EvmWalletTopProfitableWalletPerTokenResponseJSON; + +export const GetTopProfitableWalletPerTokenOperation = { + operationId: "getTopProfitableWalletPerToken", + groupName: "token", + httpMethod: "get", + routePattern: "/erc20/{address}/top-gainers", + parameterNames: ["address","days","chain"], + hasResponse: true, + hasBody: false, + + parseResponse(json: EvmWalletTopProfitableWalletPerTokenResponseJSON): EvmWalletTopProfitableWalletPerTokenResponse { + return EvmWalletTopProfitableWalletPerTokenResponse.fromJSON(json); + }, + + serializeRequest(request: GetTopProfitableWalletPerTokenOperationRequest): GetTopProfitableWalletPerTokenOperationRequestJSON { + const address = EvmAddress.create(request.address); + const days = request.days; + const chain = request.chain ? EvmChain.create(request.chain) : undefined; + return { + address: address.toJSON(), + days: days, + chain: chain ? chain.toJSON() : undefined, + }; + }, + +} diff --git a/packages/common/evmUtils/src/generated/operations/GetWalletProfitabilityOperation.ts b/packages/common/evmUtils/src/generated/operations/GetWalletProfitabilityOperation.ts new file mode 100644 index 0000000000..74a93ff011 --- /dev/null +++ b/packages/common/evmUtils/src/generated/operations/GetWalletProfitabilityOperation.ts @@ -0,0 +1,65 @@ +import { EvmAddress, EvmAddressInput, EvmAddressJSON, EvmChain, EvmChainInput, EvmChainJSON } from '../../dataTypes'; +import { EvmWalletProfitabilityResponse, EvmWalletProfitabilityResponseJSON } from '../types/EvmWalletProfitabilityResponse'; + +// request parameters: +// - address ($ref: #/paths/~1wallets~1{address}~1profitability/get/parameters/0/schema) +// - days ($ref: #/paths/~1wallets~1{address}~1profitability/get/parameters/1/schema) +// - chain ($ref: #/components/schemas/discoveryApiChainsList) +// - token_addresses ($ref: #/paths/~1wallets~1{address}~1profitability/get/parameters/3/schema) + +export interface GetWalletProfitabilityOperationRequest { + /** + * @description The wallet address for which profitability is to be retrieved. + */ + readonly address: EvmAddressInput | EvmAddress; + /** + * @description Timeframe in days for which profitability is calculated, Options include 'all', '7', '30', '60', '90' default is 'all'. + */ + readonly days?: string; + /** + * @description The chain to query + */ + readonly chain?: EvmChainInput | EvmChain; + /** + * @description The token addresses list to filter the result with + */ + readonly tokenAddresses?: EvmAddressInput[] | EvmAddress[]; +} + +export interface GetWalletProfitabilityOperationRequestJSON { + readonly address: EvmAddressJSON; + readonly days?: string; + readonly chain?: EvmChainJSON; + readonly token_addresses?: EvmAddressJSON[]; +} + +export type GetWalletProfitabilityOperationResponse = EvmWalletProfitabilityResponse; +export type GetWalletProfitabilityOperationResponseJSON = EvmWalletProfitabilityResponseJSON; + +export const GetWalletProfitabilityOperation = { + operationId: "getWalletProfitability", + groupName: "wallets", + httpMethod: "get", + routePattern: "/wallets/{address}/profitability", + parameterNames: ["address","days","chain","token_addresses"], + hasResponse: true, + hasBody: false, + + parseResponse(json: EvmWalletProfitabilityResponseJSON): EvmWalletProfitabilityResponse { + return EvmWalletProfitabilityResponse.fromJSON(json); + }, + + serializeRequest(request: GetWalletProfitabilityOperationRequest): GetWalletProfitabilityOperationRequestJSON { + const address = EvmAddress.create(request.address); + const days = request.days; + const chain = request.chain ? EvmChain.create(request.chain) : undefined; + const tokenAddresses = request.tokenAddresses ? request.tokenAddresses.map((item) => EvmAddress.create(item)) : undefined; + return { + address: address.toJSON(), + days: days, + chain: chain ? chain.toJSON() : undefined, + token_addresses: tokenAddresses ? tokenAddresses.map((item) => item.toJSON()) : undefined, + }; + }, + +} diff --git a/packages/common/evmUtils/src/generated/operations/GetWalletProfitabilitySummaryOperation.ts b/packages/common/evmUtils/src/generated/operations/GetWalletProfitabilitySummaryOperation.ts new file mode 100644 index 0000000000..7a0382b286 --- /dev/null +++ b/packages/common/evmUtils/src/generated/operations/GetWalletProfitabilitySummaryOperation.ts @@ -0,0 +1,57 @@ +import { EvmAddress, EvmAddressInput, EvmAddressJSON, EvmChain, EvmChainInput, EvmChainJSON } from '../../dataTypes'; +import { EvmGetWalletProfitabilitySummary, EvmGetWalletProfitabilitySummaryJSON } from '../types/EvmGetWalletProfitabilitySummary'; + +// request parameters: +// - address ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/parameters/0/schema) +// - days ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/parameters/1/schema) +// - chain ($ref: #/components/schemas/discoveryApiChainsList) + +export interface GetWalletProfitabilitySummaryOperationRequest { + /** + * @description The wallet address for which profitability summary is to be retrieved. + */ + readonly address: EvmAddressInput | EvmAddress; + /** + * @description Timeframe in days for the profitability summary. Options include 'all', '7', '30', '60', '90' default is 'all'. + */ + readonly days?: string; + /** + * @description The chain to query + */ + readonly chain?: EvmChainInput | EvmChain; +} + +export interface GetWalletProfitabilitySummaryOperationRequestJSON { + readonly address: EvmAddressJSON; + readonly days?: string; + readonly chain?: EvmChainJSON; +} + +export type GetWalletProfitabilitySummaryOperationResponse = EvmGetWalletProfitabilitySummary; +export type GetWalletProfitabilitySummaryOperationResponseJSON = EvmGetWalletProfitabilitySummaryJSON; + +export const GetWalletProfitabilitySummaryOperation = { + operationId: "getWalletProfitabilitySummary", + groupName: "wallets", + httpMethod: "get", + routePattern: "/wallets/{address}/profitability/summary", + parameterNames: ["address","days","chain"], + hasResponse: true, + hasBody: false, + + parseResponse(json: EvmGetWalletProfitabilitySummaryJSON): EvmGetWalletProfitabilitySummary { + return EvmGetWalletProfitabilitySummary.fromJSON(json); + }, + + serializeRequest(request: GetWalletProfitabilitySummaryOperationRequest): GetWalletProfitabilitySummaryOperationRequestJSON { + const address = EvmAddress.create(request.address); + const days = request.days; + const chain = request.chain ? EvmChain.create(request.chain) : undefined; + return { + address: address.toJSON(), + days: days, + chain: chain ? chain.toJSON() : undefined, + }; + }, + +} diff --git a/packages/common/evmUtils/src/generated/operations/index.ts b/packages/common/evmUtils/src/generated/operations/index.ts index 8e73171f22..427aafe884 100644 --- a/packages/common/evmUtils/src/generated/operations/index.ts +++ b/packages/common/evmUtils/src/generated/operations/index.ts @@ -26,4 +26,7 @@ export * from './GetNFTCollectionStatsOperation'; export * from './GetNFTTokenStatsOperation'; export * from './GetTokenStatsOperation'; export * from './GetBlockStatsOperation'; +export * from './GetWalletProfitabilitySummaryOperation'; +export * from './GetWalletProfitabilityOperation'; +export * from './GetTopProfitableWalletPerTokenOperation'; export * from './operations'; diff --git a/packages/common/evmUtils/src/generated/operations/operations.ts b/packages/common/evmUtils/src/generated/operations/operations.ts index 8e3d1fd15c..e635217247 100644 --- a/packages/common/evmUtils/src/generated/operations/operations.ts +++ b/packages/common/evmUtils/src/generated/operations/operations.ts @@ -26,6 +26,9 @@ import { GetNFTCollectionStatsOperation } from './GetNFTCollectionStatsOperation import { GetNFTTokenStatsOperation } from './GetNFTTokenStatsOperation'; import { GetTokenStatsOperation } from './GetTokenStatsOperation'; import { GetBlockStatsOperation } from './GetBlockStatsOperation'; +import { GetWalletProfitabilitySummaryOperation } from './GetWalletProfitabilitySummaryOperation'; +import { GetWalletProfitabilityOperation } from './GetWalletProfitabilityOperation'; +import { GetTopProfitableWalletPerTokenOperation } from './GetTopProfitableWalletPerTokenOperation'; export const operations = [ GetNFTTradesOperation, @@ -56,4 +59,7 @@ export const operations = [ GetNFTTokenStatsOperation, GetTokenStatsOperation, GetBlockStatsOperation, + GetWalletProfitabilitySummaryOperation, + GetWalletProfitabilityOperation, + GetTopProfitableWalletPerTokenOperation, ]; diff --git a/packages/common/evmUtils/src/generated/types/EvmDiscoveryApiChainsList.ts b/packages/common/evmUtils/src/generated/types/EvmDiscoveryApiChainsList.ts new file mode 100644 index 0000000000..c69af48235 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmDiscoveryApiChainsList.ts @@ -0,0 +1,16 @@ +// $ref: #/components/schemas/discoveryApiChainsList +// typeName: discoveryApiChainsList + +export type EvmDiscoveryApiChainsListJSON = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105"; +export type EvmDiscoveryApiChainsListInput = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105"; +export type EvmDiscoveryApiChainsListValue = "eth" | "mainnet" | "0x1" | "matic" | "0x89" | "polygon" | "bsc" | "binance" | "0x38" | "fantom" | "ftm" | "0xfa" | "arbitrum" | "0xa4b1" | "optimism" | "0xa" | "pulsechain" | "0x171" | "base" | "0x2105"; + +export abstract class EvmDiscoveryApiChainsList { + public static create(input: EvmDiscoveryApiChainsListInput | EvmDiscoveryApiChainsListValue): EvmDiscoveryApiChainsListValue { + return input; + } + + public static fromJSON(json: EvmDiscoveryApiChainsListJSON): EvmDiscoveryApiChainsListValue { + return json; + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmGetWalletProfitabilitySummary.ts b/packages/common/evmUtils/src/generated/types/EvmGetWalletProfitabilitySummary.ts new file mode 100644 index 0000000000..c79c97ab64 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmGetWalletProfitabilitySummary.ts @@ -0,0 +1,113 @@ +// $ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema +// type: getWalletProfitabilitySummary +// properties: +// - total_count_of_trades ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_count_of_trades) +// - total_trade_volume ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_trade_volume) +// - total_realized_profit_usd ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_realized_profit_usd) +// - total_realized_profit_percentage ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_realized_profit_percentage) +// - total_buys ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_buys) +// - total_sells ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_sells) +// - total_sold_volume_usd ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_sold_volume_usd) +// - total_bought_volume_usd ($ref: #/paths/~1wallets~1{address}~1profitability~1summary/get/responses/200/content/application~1json/schema/properties/total_bought_volume_usd) + +export interface EvmGetWalletProfitabilitySummaryJSON { + readonly total_count_of_trades?: number; + readonly total_trade_volume?: string; + readonly total_realized_profit_usd?: string; + readonly total_realized_profit_percentage?: number; + readonly total_buys?: number; + readonly total_sells?: number; + readonly total_sold_volume_usd?: string; + readonly total_bought_volume_usd?: string; +} + +export interface EvmGetWalletProfitabilitySummaryInput { + readonly totalCountOfTrades?: number; + readonly totalTradeVolume?: string; + readonly totalRealizedProfitUsd?: string; + readonly totalRealizedProfitPercentage?: number; + readonly totalBuys?: number; + readonly totalSells?: number; + readonly totalSoldVolumeUsd?: string; + readonly totalBoughtVolumeUsd?: string; +} + +export class EvmGetWalletProfitabilitySummary { + public static create(input: EvmGetWalletProfitabilitySummaryInput | EvmGetWalletProfitabilitySummary): EvmGetWalletProfitabilitySummary { + if (input instanceof EvmGetWalletProfitabilitySummary) { + return input; + } + return new EvmGetWalletProfitabilitySummary(input); + } + + public static fromJSON(json: EvmGetWalletProfitabilitySummaryJSON): EvmGetWalletProfitabilitySummary { + const input: EvmGetWalletProfitabilitySummaryInput = { + totalCountOfTrades: json.total_count_of_trades, + totalTradeVolume: json.total_trade_volume, + totalRealizedProfitUsd: json.total_realized_profit_usd, + totalRealizedProfitPercentage: json.total_realized_profit_percentage, + totalBuys: json.total_buys, + totalSells: json.total_sells, + totalSoldVolumeUsd: json.total_sold_volume_usd, + totalBoughtVolumeUsd: json.total_bought_volume_usd, + }; + return EvmGetWalletProfitabilitySummary.create(input); + } + + /** + * @description Total count of trades executed by the wallet. + */ + public readonly totalCountOfTrades?: number; + /** + * @description Total trade volume managed by the wallet. + */ + public readonly totalTradeVolume?: string; + /** + * @description Total realized profit in USD for the wallet. + */ + public readonly totalRealizedProfitUsd?: string; + /** + * @description Total realized profit as a percentage. + */ + public readonly totalRealizedProfitPercentage?: number; + /** + * @description Total number of buy transactions. + */ + public readonly totalBuys?: number; + /** + * @description Total number of sell transactions. + */ + public readonly totalSells?: number; + /** + * @description Total USD volume of tokens sold by the wallet. + */ + public readonly totalSoldVolumeUsd?: string; + /** + * @description Total USD volume of tokens bought by the wallet. + */ + public readonly totalBoughtVolumeUsd?: string; + + private constructor(input: EvmGetWalletProfitabilitySummaryInput) { + this.totalCountOfTrades = input.totalCountOfTrades; + this.totalTradeVolume = input.totalTradeVolume; + this.totalRealizedProfitUsd = input.totalRealizedProfitUsd; + this.totalRealizedProfitPercentage = input.totalRealizedProfitPercentage; + this.totalBuys = input.totalBuys; + this.totalSells = input.totalSells; + this.totalSoldVolumeUsd = input.totalSoldVolumeUsd; + this.totalBoughtVolumeUsd = input.totalBoughtVolumeUsd; + } + + public toJSON(): EvmGetWalletProfitabilitySummaryJSON { + return { + total_count_of_trades: this.totalCountOfTrades, + total_trade_volume: this.totalTradeVolume, + total_realized_profit_usd: this.totalRealizedProfitUsd, + total_realized_profit_percentage: this.totalRealizedProfitPercentage, + total_buys: this.totalBuys, + total_sells: this.totalSells, + total_sold_volume_usd: this.totalSoldVolumeUsd, + total_bought_volume_usd: this.totalBoughtVolumeUsd, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmTopProfitableWalletPerTokenResponse.ts b/packages/common/evmUtils/src/generated/types/EvmTopProfitableWalletPerTokenResponse.ts new file mode 100644 index 0000000000..d4322d5bf5 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmTopProfitableWalletPerTokenResponse.ts @@ -0,0 +1,155 @@ +import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; + +// $ref: #/components/schemas/TopProfitableWalletPerTokenResponse +// type: TopProfitableWalletPerTokenResponse +// properties: +// - avg_buy_price_usd ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/avg_buy_price_usd) +// - avg_cost_of_quantity_sold ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/avg_cost_of_quantity_sold) +// - avg_sell_price_usd ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/avg_sell_price_usd) +// - count_of_trades ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/count_of_trades) +// - realized_profit_percentage ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/realized_profit_percentage) +// - realized_profit_usd ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/realized_profit_usd) +// - total_profit_usd ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/total_profit_usd) +// - total_sold_usd ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/total_sold_usd) +// - total_tokens_bought ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/total_tokens_bought) +// - total_tokens_sold ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/total_tokens_sold) +// - total_usd_invested ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/total_usd_invested) +// - address ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse/properties/address) + +export interface EvmTopProfitableWalletPerTokenResponseJSON { + readonly avg_buy_price_usd: string; + readonly avg_cost_of_quantity_sold: string; + readonly avg_sell_price_usd: string; + readonly count_of_trades: number; + readonly realized_profit_percentage: number; + readonly realized_profit_usd: string; + readonly total_profit_usd?: string; + readonly total_sold_usd: string; + readonly total_tokens_bought: string; + readonly total_tokens_sold: string; + readonly total_usd_invested: string; + readonly address: EvmAddressJSON; +} + +export interface EvmTopProfitableWalletPerTokenResponseInput { + readonly avgBuyPriceUsd: string; + readonly avgCostOfQuantitySold: string; + readonly avgSellPriceUsd: string; + readonly countOfTrades: number; + readonly realizedProfitPercentage: number; + readonly realizedProfitUsd: string; + readonly totalProfitUsd?: string; + readonly totalSoldUsd: string; + readonly totalTokensBought: string; + readonly totalTokensSold: string; + readonly totalUsdInvested: string; + readonly address: EvmAddressInput | EvmAddress; +} + +export class EvmTopProfitableWalletPerTokenResponse { + public static create(input: EvmTopProfitableWalletPerTokenResponseInput | EvmTopProfitableWalletPerTokenResponse): EvmTopProfitableWalletPerTokenResponse { + if (input instanceof EvmTopProfitableWalletPerTokenResponse) { + return input; + } + return new EvmTopProfitableWalletPerTokenResponse(input); + } + + public static fromJSON(json: EvmTopProfitableWalletPerTokenResponseJSON): EvmTopProfitableWalletPerTokenResponse { + const input: EvmTopProfitableWalletPerTokenResponseInput = { + avgBuyPriceUsd: json.avg_buy_price_usd, + avgCostOfQuantitySold: json.avg_cost_of_quantity_sold, + avgSellPriceUsd: json.avg_sell_price_usd, + countOfTrades: json.count_of_trades, + realizedProfitPercentage: json.realized_profit_percentage, + realizedProfitUsd: json.realized_profit_usd, + totalProfitUsd: json.total_profit_usd, + totalSoldUsd: json.total_sold_usd, + totalTokensBought: json.total_tokens_bought, + totalTokensSold: json.total_tokens_sold, + totalUsdInvested: json.total_usd_invested, + address: EvmAddress.fromJSON(json.address), + }; + return EvmTopProfitableWalletPerTokenResponse.create(input); + } + + /** + * @description Average buy price in USD. + */ + public readonly avgBuyPriceUsd: string; + /** + * @description Average cost of quantity sold. + */ + public readonly avgCostOfQuantitySold: string; + /** + * @description Average sell price in USD. + */ + public readonly avgSellPriceUsd: string; + /** + * @description Total number of trades. + */ + public readonly countOfTrades: number; + /** + * @description Realized profit as a percentage. + */ + public readonly realizedProfitPercentage: number; + /** + * @description Realized profit in USD. + */ + public readonly realizedProfitUsd: string; + /** + * @description Total profit in USD. + */ + public readonly totalProfitUsd?: string; + /** + * @description Total amount in USD for sold tokens. + */ + public readonly totalSoldUsd: string; + /** + * @description Total number of tokens bought. + */ + public readonly totalTokensBought: string; + /** + * @description Total number of tokens sold. + */ + public readonly totalTokensSold: string; + /** + * @description Total amount of USD invested. + */ + public readonly totalUsdInvested: string; + /** + * @description The wallet address. + */ + public readonly address: EvmAddress; + + private constructor(input: EvmTopProfitableWalletPerTokenResponseInput) { + this.avgBuyPriceUsd = input.avgBuyPriceUsd; + this.avgCostOfQuantitySold = input.avgCostOfQuantitySold; + this.avgSellPriceUsd = input.avgSellPriceUsd; + this.countOfTrades = input.countOfTrades; + this.realizedProfitPercentage = input.realizedProfitPercentage; + this.realizedProfitUsd = input.realizedProfitUsd; + this.totalProfitUsd = input.totalProfitUsd; + this.totalSoldUsd = input.totalSoldUsd; + this.totalTokensBought = input.totalTokensBought; + this.totalTokensSold = input.totalTokensSold; + this.totalUsdInvested = input.totalUsdInvested; + this.address = EvmAddress.create(input.address); + } + + public toJSON(): EvmTopProfitableWalletPerTokenResponseJSON { + return { + avg_buy_price_usd: this.avgBuyPriceUsd, + avg_cost_of_quantity_sold: this.avgCostOfQuantitySold, + avg_sell_price_usd: this.avgSellPriceUsd, + count_of_trades: this.countOfTrades, + realized_profit_percentage: this.realizedProfitPercentage, + realized_profit_usd: this.realizedProfitUsd, + total_profit_usd: this.totalProfitUsd, + total_sold_usd: this.totalSoldUsd, + total_tokens_bought: this.totalTokensBought, + total_tokens_sold: this.totalTokensSold, + total_usd_invested: this.totalUsdInvested, + address: this.address.toJSON(), + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletProfitabilityResponse.ts b/packages/common/evmUtils/src/generated/types/EvmWalletProfitabilityResponse.ts new file mode 100644 index 0000000000..1824fc9fec --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmWalletProfitabilityResponse.ts @@ -0,0 +1,45 @@ +import { EvmWalletProfitabilityTokenData, EvmWalletProfitabilityTokenDataInput, EvmWalletProfitabilityTokenDataJSON } from '../types/EvmWalletProfitabilityTokenData'; + +// $ref: #/components/schemas/WalletProfitabilityResponse +// type: WalletProfitabilityResponse +// properties: +// - result ($ref: #/components/schemas/WalletProfitabilityTokenData) + +export interface EvmWalletProfitabilityResponseJSON { + readonly result?: EvmWalletProfitabilityTokenDataJSON[]; +} + +export interface EvmWalletProfitabilityResponseInput { + readonly result?: EvmWalletProfitabilityTokenDataInput[] | EvmWalletProfitabilityTokenData[]; +} + +export class EvmWalletProfitabilityResponse { + public static create(input: EvmWalletProfitabilityResponseInput | EvmWalletProfitabilityResponse): EvmWalletProfitabilityResponse { + if (input instanceof EvmWalletProfitabilityResponse) { + return input; + } + return new EvmWalletProfitabilityResponse(input); + } + + public static fromJSON(json: EvmWalletProfitabilityResponseJSON): EvmWalletProfitabilityResponse { + const input: EvmWalletProfitabilityResponseInput = { + result: json.result ? json.result.map((item) => EvmWalletProfitabilityTokenData.fromJSON(item)) : undefined, + }; + return EvmWalletProfitabilityResponse.create(input); + } + + /** + * @description List of tokens traded with their respective profitability data. + */ + public readonly result?: EvmWalletProfitabilityTokenData[]; + + private constructor(input: EvmWalletProfitabilityResponseInput) { + this.result = input.result ? input.result.map((item) => EvmWalletProfitabilityTokenData.create(item)) : undefined; + } + + public toJSON(): EvmWalletProfitabilityResponseJSON { + return { + result: this.result ? this.result.map((item) => item.toJSON()) : undefined, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletProfitabilityTokenData.ts b/packages/common/evmUtils/src/generated/types/EvmWalletProfitabilityTokenData.ts new file mode 100644 index 0000000000..7a418f3894 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmWalletProfitabilityTokenData.ts @@ -0,0 +1,235 @@ +import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; + +// $ref: #/components/schemas/WalletProfitabilityTokenData +// type: WalletProfitabilityTokenData +// properties: +// - token_address ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/token_address) +// - avg_buy_price_usd ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/avg_buy_price_usd) +// - avg_sell_price_usd ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/avg_sell_price_usd) +// - total_usd_invested ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/total_usd_invested) +// - total_tokens_sold ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/total_tokens_sold) +// - total_tokens_bought ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/total_tokens_bought) +// - total_sold_usd ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/total_sold_usd) +// - avg_cost_of_quantity_sold ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/avg_cost_of_quantity_sold) +// - count_of_trades ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/count_of_trades) +// - realized_profit_usd ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/realized_profit_usd) +// - realized_profit_percentage ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/realized_profit_percentage) +// - total_buys ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/total_buys) +// - total_sells ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/total_sells) +// - name ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/name) +// - symbol ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/symbol) +// - decimals ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/decimals) +// - logo ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/logo) +// - logo_hash ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/logo_hash) +// - thumbnail ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/thumbnail) +// - possible_spam ($ref: #/components/schemas/WalletProfitabilityTokenData/properties/possible_spam) + +export interface EvmWalletProfitabilityTokenDataJSON { + readonly token_address: EvmAddressJSON; + readonly avg_buy_price_usd: string; + readonly avg_sell_price_usd: string; + readonly total_usd_invested: string; + readonly total_tokens_sold: string; + readonly total_tokens_bought: string; + readonly total_sold_usd: string; + readonly avg_cost_of_quantity_sold: string; + readonly count_of_trades: number; + readonly realized_profit_usd: string; + readonly realized_profit_percentage: number; + readonly total_buys: number; + readonly total_sells: number; + readonly name: string; + readonly symbol: string; + readonly decimals: string; + readonly logo: string; + readonly logo_hash: string; + readonly thumbnail: string; + readonly possible_spam?: boolean; +} + +export interface EvmWalletProfitabilityTokenDataInput { + readonly tokenAddress: EvmAddressInput | EvmAddress; + readonly avgBuyPriceUsd: string; + readonly avgSellPriceUsd: string; + readonly totalUsdInvested: string; + readonly totalTokensSold: string; + readonly totalTokensBought: string; + readonly totalSoldUsd: string; + readonly avgCostOfQuantitySold: string; + readonly countOfTrades: number; + readonly realizedProfitUsd: string; + readonly realizedProfitPercentage: number; + readonly totalBuys: number; + readonly totalSells: number; + readonly name: string; + readonly symbol: string; + readonly decimals: number; + readonly logo: string; + readonly logoHash: string; + readonly thumbnail: string; + readonly possibleSpam?: boolean; +} + +export class EvmWalletProfitabilityTokenData { + public static create(input: EvmWalletProfitabilityTokenDataInput | EvmWalletProfitabilityTokenData): EvmWalletProfitabilityTokenData { + if (input instanceof EvmWalletProfitabilityTokenData) { + return input; + } + return new EvmWalletProfitabilityTokenData(input); + } + + public static fromJSON(json: EvmWalletProfitabilityTokenDataJSON): EvmWalletProfitabilityTokenData { + const input: EvmWalletProfitabilityTokenDataInput = { + tokenAddress: EvmAddress.fromJSON(json.token_address), + avgBuyPriceUsd: json.avg_buy_price_usd, + avgSellPriceUsd: json.avg_sell_price_usd, + totalUsdInvested: json.total_usd_invested, + totalTokensSold: json.total_tokens_sold, + totalTokensBought: json.total_tokens_bought, + totalSoldUsd: json.total_sold_usd, + avgCostOfQuantitySold: json.avg_cost_of_quantity_sold, + countOfTrades: json.count_of_trades, + realizedProfitUsd: json.realized_profit_usd, + realizedProfitPercentage: json.realized_profit_percentage, + totalBuys: json.total_buys, + totalSells: json.total_sells, + name: json.name, + symbol: json.symbol, + decimals: Number(json.decimals), + logo: json.logo, + logoHash: json.logo_hash, + thumbnail: json.thumbnail, + possibleSpam: json.possible_spam, + }; + return EvmWalletProfitabilityTokenData.create(input); + } + + /** + * @description The address of the traded token. + */ + public readonly tokenAddress: EvmAddress; + /** + * @description Average buy price in USD. + */ + public readonly avgBuyPriceUsd: string; + /** + * @description Average sell price in USD. + */ + public readonly avgSellPriceUsd: string; + /** + * @description Total USD invested. + */ + public readonly totalUsdInvested: string; + /** + * @description Total tokens sold. + */ + public readonly totalTokensSold: string; + /** + * @description Total tokens bought. + */ + public readonly totalTokensBought: string; + /** + * @description Total USD received from selling tokens. + */ + public readonly totalSoldUsd: string; + /** + * @description Average cost of sold quantity. + */ + public readonly avgCostOfQuantitySold: string; + /** + * @description Count of trades for the token. + */ + public readonly countOfTrades: number; + /** + * @description Realized profit in USD for the token. + */ + public readonly realizedProfitUsd: string; + /** + * @description Realized profit percentage for the token. + */ + public readonly realizedProfitPercentage: number; + /** + * @description Total number of buys. + */ + public readonly totalBuys: number; + /** + * @description Total number of sells. + */ + public readonly totalSells: number; + /** + * @description Name of the token. + */ + public readonly name: string; + /** + * @description Symbol of the token. + */ + public readonly symbol: string; + /** + * @description Decimals of the token. + */ + public readonly decimals: number; + /** + * @description Logo URL of the token. + */ + public readonly logo: string; + /** + * @description Logo hash of the token. + */ + public readonly logoHash: string; + /** + * @description Thumbnail image URL of the token. + */ + public readonly thumbnail: string; + /** + * @description Indicates whether the token is possibly spam. + */ + public readonly possibleSpam?: boolean; + + private constructor(input: EvmWalletProfitabilityTokenDataInput) { + this.tokenAddress = EvmAddress.create(input.tokenAddress); + this.avgBuyPriceUsd = input.avgBuyPriceUsd; + this.avgSellPriceUsd = input.avgSellPriceUsd; + this.totalUsdInvested = input.totalUsdInvested; + this.totalTokensSold = input.totalTokensSold; + this.totalTokensBought = input.totalTokensBought; + this.totalSoldUsd = input.totalSoldUsd; + this.avgCostOfQuantitySold = input.avgCostOfQuantitySold; + this.countOfTrades = input.countOfTrades; + this.realizedProfitUsd = input.realizedProfitUsd; + this.realizedProfitPercentage = input.realizedProfitPercentage; + this.totalBuys = input.totalBuys; + this.totalSells = input.totalSells; + this.name = input.name; + this.symbol = input.symbol; + this.decimals = input.decimals; + this.logo = input.logo; + this.logoHash = input.logoHash; + this.thumbnail = input.thumbnail; + this.possibleSpam = input.possibleSpam; + } + + public toJSON(): EvmWalletProfitabilityTokenDataJSON { + return { + token_address: this.tokenAddress.toJSON(), + avg_buy_price_usd: this.avgBuyPriceUsd, + avg_sell_price_usd: this.avgSellPriceUsd, + total_usd_invested: this.totalUsdInvested, + total_tokens_sold: this.totalTokensSold, + total_tokens_bought: this.totalTokensBought, + total_sold_usd: this.totalSoldUsd, + avg_cost_of_quantity_sold: this.avgCostOfQuantitySold, + count_of_trades: this.countOfTrades, + realized_profit_usd: this.realizedProfitUsd, + realized_profit_percentage: this.realizedProfitPercentage, + total_buys: this.totalBuys, + total_sells: this.totalSells, + name: this.name, + symbol: this.symbol, + decimals: String(this.decimals), + logo: this.logo, + logo_hash: this.logoHash, + thumbnail: this.thumbnail, + possible_spam: this.possibleSpam, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletTopProfitableWalletPerTokenResponse.ts b/packages/common/evmUtils/src/generated/types/EvmWalletTopProfitableWalletPerTokenResponse.ts new file mode 100644 index 0000000000..4a5236b45a --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmWalletTopProfitableWalletPerTokenResponse.ts @@ -0,0 +1,45 @@ +import { EvmTopProfitableWalletPerTokenResponse, EvmTopProfitableWalletPerTokenResponseInput, EvmTopProfitableWalletPerTokenResponseJSON } from '../types/EvmTopProfitableWalletPerTokenResponse'; + +// $ref: #/components/schemas/WalletTopProfitableWalletPerTokenResponse +// type: WalletTopProfitableWalletPerTokenResponse +// properties: +// - wallets ($ref: #/components/schemas/TopProfitableWalletPerTokenResponse) + +export interface EvmWalletTopProfitableWalletPerTokenResponseJSON { + readonly wallets: EvmTopProfitableWalletPerTokenResponseJSON[]; +} + +export interface EvmWalletTopProfitableWalletPerTokenResponseInput { + readonly wallets: EvmTopProfitableWalletPerTokenResponseInput[] | EvmTopProfitableWalletPerTokenResponse[]; +} + +export class EvmWalletTopProfitableWalletPerTokenResponse { + public static create(input: EvmWalletTopProfitableWalletPerTokenResponseInput | EvmWalletTopProfitableWalletPerTokenResponse): EvmWalletTopProfitableWalletPerTokenResponse { + if (input instanceof EvmWalletTopProfitableWalletPerTokenResponse) { + return input; + } + return new EvmWalletTopProfitableWalletPerTokenResponse(input); + } + + public static fromJSON(json: EvmWalletTopProfitableWalletPerTokenResponseJSON): EvmWalletTopProfitableWalletPerTokenResponse { + const input: EvmWalletTopProfitableWalletPerTokenResponseInput = { + wallets: json.wallets.map((item) => EvmTopProfitableWalletPerTokenResponse.fromJSON(item)), + }; + return EvmWalletTopProfitableWalletPerTokenResponse.create(input); + } + + /** + * @description List of top profitable wallets per token. + */ + public readonly wallets: EvmTopProfitableWalletPerTokenResponse[]; + + private constructor(input: EvmWalletTopProfitableWalletPerTokenResponseInput) { + this.wallets = input.wallets.map((item) => EvmTopProfitableWalletPerTokenResponse.create(item)); + } + + public toJSON(): EvmWalletTopProfitableWalletPerTokenResponseJSON { + return { + wallets: this.wallets.map((item) => item.toJSON()), + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/index.ts b/packages/common/evmUtils/src/generated/types/index.ts index d74534c250..6361ed4be9 100644 --- a/packages/common/evmUtils/src/generated/types/index.ts +++ b/packages/common/evmUtils/src/generated/types/index.ts @@ -5,6 +5,7 @@ export * from './EvmGetMultipleTokenPricesIncludeEnum'; export * from './EvmOrderList'; export * from './EvmResolveAddressToDomainCurrencyEnum'; export * from './EvmDefiProtocolList'; +export * from './EvmDiscoveryApiChainsList'; export * from './EvmETransactionCategory'; export * from './EvmErc20MetadataLinks'; export * from './EvmContractsReviewItemReportTypeEnum'; @@ -39,6 +40,9 @@ export * from './EvmNftCollectionStat'; export * from './EvmNftTokenStat'; export * from './EvmErc20TokenStat'; export * from './EvmBlockTokenStat'; +export * from './EvmGetWalletProfitabilitySummary'; +export * from './EvmWalletProfitabilityResponse'; +export * from './EvmWalletTopProfitableWalletPerTokenResponse'; export * from './EvmTrade'; export * from './EvmSoldPriceLastSale'; export * from './EvmSoldPriceLowestSale'; @@ -65,6 +69,8 @@ export * from './EvmNftTokenStatTransfers'; export * from './EvmErc20TokenStatTransfers'; export * from './EvmBlockTokenStatTransactions'; export * from './EvmBlockTokenStatNftTransfers'; +export * from './EvmWalletProfitabilityTokenData'; +export * from './EvmTopProfitableWalletPerTokenResponse'; export * from './EvmSoldPriceLastSalePaymentToken'; export * from './EvmSoldPriceLowestSalePaymentToken'; export * from './EvmSoldPriceHighestSalePaymentToken'; diff --git a/packages/evmApi/src/generated/ClientEvmApi.ts b/packages/evmApi/src/generated/ClientEvmApi.ts index 8d87032497..9d2ac3bdd0 100644 --- a/packages/evmApi/src/generated/ClientEvmApi.ts +++ b/packages/evmApi/src/generated/ClientEvmApi.ts @@ -1,6 +1,6 @@ // CAUTION: This file is automatically generated. Do not edit it manually! -import { getBlockOperation, GetBlockRequest, GetBlockResponseAdapter, getDateToBlockOperation, GetDateToBlockRequest, GetDateToBlockResponseAdapter, GetBlockStatsOperationResponseJSON, GetBlockStatsOperation, GetBlockStatsOperationRequest, GetBlockStatsOperationResponse, getContractEventsOperation, GetContractEventsRequest, GetContractEventsResponseAdapter, getContractLogsOperation, GetContractLogsRequest, GetContractLogsResponseAdapter, getContractNFTsOperation, GetContractNFTsRequest, GetContractNFTsResponseAdapter, getMultipleNFTsOperation, GetMultipleNFTsRequest, GetMultipleNFTsResponseAdapter, getNFTContractMetadataOperation, GetNFTContractMetadataRequest, GetNFTContractMetadataResponseAdapter, getNFTContractTransfersOperation, GetNFTContractTransfersRequest, GetNFTContractTransfersResponseAdapter, getNFTLowestPriceOperation, GetNFTLowestPriceRequest, GetNFTLowestPriceResponseAdapter, getNFTMetadataOperation, GetNFTMetadataRequest, GetNFTMetadataResponseAdapter, getNFTOwnersOperation, GetNFTOwnersRequest, GetNFTOwnersResponseAdapter, getNFTTokenIdOwnersOperation, GetNFTTokenIdOwnersRequest, GetNFTTokenIdOwnersResponseAdapter, getNFTTransfersByBlockOperation, GetNFTTransfersByBlockRequest, GetNFTTransfersByBlockResponseAdapter, getNFTTransfersFromToBlockOperation, GetNFTTransfersFromToBlockRequest, GetNFTTransfersFromToBlockResponseAdapter, getNFTTransfersOperation, GetNFTTransfersRequest, GetNFTTransfersResponseAdapter, getWalletNFTCollectionsOperation, GetWalletNFTCollectionsRequest, GetWalletNFTCollectionsResponseAdapter, getWalletNFTsOperation, GetWalletNFTsRequest, GetWalletNFTsResponseAdapter, getWalletNFTTransfersOperation, GetWalletNFTTransfersRequest, GetWalletNFTTransfersResponseAdapter, reSyncMetadataOperation, ReSyncMetadataRequest, ReSyncMetadataResponseAdapter, syncNFTContractOperation, SyncNFTContractRequest, SyncNFTContractResponseAdapter, GetNFTTradesOperationResponseJSON, GetNFTTradesOperation, GetNFTTradesOperationRequest, GetNFTTradesOperationResponse, GetNFTContractSalePricesOperationResponseJSON, GetNFTContractSalePricesOperation, GetNFTContractSalePricesOperationRequest, GetNFTContractSalePricesOperationResponse, GetNFTSalePricesOperationResponseJSON, GetNFTSalePricesOperation, GetNFTSalePricesOperationRequest, GetNFTSalePricesOperationResponse, GetNFTCollectionStatsOperationResponseJSON, GetNFTCollectionStatsOperation, GetNFTCollectionStatsOperationRequest, GetNFTCollectionStatsOperationResponse, GetNFTTokenStatsOperationResponseJSON, GetNFTTokenStatsOperation, GetNFTTokenStatsOperationRequest, GetNFTTokenStatsOperationResponse, getInternalTransactionsOperation, GetInternalTransactionsRequest, GetInternalTransactionsResponseAdapter, getTransactionOperation, GetTransactionRequest, GetTransactionResponseAdapter, getTransactionVerboseOperation, GetTransactionVerboseRequest, GetTransactionVerboseResponseAdapter, getWalletTransactionsOperation, GetWalletTransactionsRequest, GetWalletTransactionsResponseAdapter, getWalletTransactionsVerboseOperation, GetWalletTransactionsVerboseRequest, GetWalletTransactionsVerboseResponseAdapter, getNativeBalanceOperation, GetNativeBalanceRequest, GetNativeBalanceResponseAdapter, getNativeBalancesForAddressesOperation, GetNativeBalancesForAddressesRequest, GetNativeBalancesForAddressesResponseAdapter, getPairAddressOperation, GetPairAddressRequest, GetPairAddressResponseAdapter, getPairReservesOperation, GetPairReservesRequest, GetPairReservesResponseAdapter, GetPairPriceOperationResponseJSON, GetPairPriceOperation, GetPairPriceOperationRequest, GetPairPriceOperationResponse, getTokenAllowanceOperation, GetTokenAllowanceRequest, GetTokenAllowanceResponseAdapter, getTokenMetadataBySymbolOperation, GetTokenMetadataBySymbolRequest, GetTokenMetadataBySymbolResponseAdapter, getTokenMetadataOperation, GetTokenMetadataRequest, GetTokenMetadataResponseAdapter, getTokenPriceOperation, GetTokenPriceRequest, GetTokenPriceResponseAdapter, getTokenTransfersOperation, GetTokenTransfersRequest, GetTokenTransfersResponseAdapter, getWalletTokenBalancesOperation, GetWalletTokenBalancesRequest, GetWalletTokenBalancesResponseAdapter, getWalletTokenTransfersOperation, GetWalletTokenTransfersRequest, GetWalletTokenTransfersResponseAdapter, GetMultipleTokenPricesOperationResponseJSON, GetMultipleTokenPricesOperation, GetMultipleTokenPricesOperationRequest, GetMultipleTokenPricesOperationBody, GetMultipleTokenPricesOperationResponse, GetTokenOwnersOperationResponseJSON, GetTokenOwnersOperation, GetTokenOwnersOperationRequest, GetTokenOwnersOperationResponse, GetTokenStatsOperationResponseJSON, GetTokenStatsOperation, GetTokenStatsOperationRequest, GetTokenStatsOperationResponse, resolveAddressOperation, ResolveAddressRequest, ResolveAddressResponseAdapter, resolveDomainOperation, ResolveDomainRequest, ResolveDomainResponseAdapter, resolveENSDomainOperation, ResolveENSDomainRequest, ResolveENSDomainResponseAdapter, ResolveAddressToDomainOperationResponseJSON, ResolveAddressToDomainOperation, ResolveAddressToDomainOperationRequest, ResolveAddressToDomainOperationResponse, runContractFunctionOperation, RunContractFunctionRequest, RunContractFunctionResponseAdapter, Web3ApiVersionOperationResponseJSON, Web3ApiVersionOperation, Web3ApiVersionOperationResponse, EndpointWeightsOperationResponseJSON, EndpointWeightsOperation, EndpointWeightsOperationResponse, ReviewContractsOperationResponseJSON, ReviewContractsOperation, ReviewContractsOperationRequest, ReviewContractsOperationBody, ReviewContractsOperationResponse, uploadFolderOperation, UploadFolderRequest, UploadFolderResponseAdapter, GetWalletHistoryOperationResponseJSON, GetWalletHistoryOperation, GetWalletHistoryOperationRequest, GetWalletHistoryOperationResponse, GetWalletTokenBalancesPriceOperationResponseJSON, GetWalletTokenBalancesPriceOperation, GetWalletTokenBalancesPriceOperationRequest, GetWalletTokenBalancesPriceOperationResponse, GetWalletNetWorthOperationResponseJSON, GetWalletNetWorthOperation, GetWalletNetWorthOperationRequest, GetWalletNetWorthOperationResponse, GetDefiSummaryOperationResponseJSON, GetDefiSummaryOperation, GetDefiSummaryOperationRequest, GetDefiSummaryOperationResponse, GetDefiPositionsByProtocolOperationResponseJSON, GetDefiPositionsByProtocolOperation, GetDefiPositionsByProtocolOperationRequest, GetDefiPositionsByProtocolOperationResponse, GetDefiPositionsSummaryOperationResponseJSON, GetDefiPositionsSummaryOperation, GetDefiPositionsSummaryOperationRequest, GetDefiPositionsSummaryOperationResponse, GetWalletActiveChainsOperationResponseJSON, GetWalletActiveChainsOperation, GetWalletActiveChainsOperationRequest, GetWalletActiveChainsOperationResponse, GetWalletStatsOperationResponseJSON, GetWalletStatsOperation, GetWalletStatsOperationRequest, GetWalletStatsOperationResponse, GetTopERC20TokensByMarketCapOperationResponseJSON, GetTopERC20TokensByMarketCapOperation, GetTopERC20TokensByMarketCapOperationResponse, GetTopERC20TokensByPriceMoversOperationResponseJSON, GetTopERC20TokensByPriceMoversOperation, GetTopERC20TokensByPriceMoversOperationResponse, GetTopNFTCollectionsByMarketCapOperationResponseJSON, GetTopNFTCollectionsByMarketCapOperation, GetTopNFTCollectionsByMarketCapOperationResponse, GetHottestNFTCollectionsByTradingVolumeOperationResponseJSON, GetHottestNFTCollectionsByTradingVolumeOperation, GetHottestNFTCollectionsByTradingVolumeOperationResponse, GetTopCryptoCurrenciesByMarketCapOperationResponseJSON, GetTopCryptoCurrenciesByMarketCapOperation, GetTopCryptoCurrenciesByMarketCapOperationResponse, GetTopCryptoCurrenciesByTradingVolumeOperationResponseJSON, GetTopCryptoCurrenciesByTradingVolumeOperation, GetTopCryptoCurrenciesByTradingVolumeOperationResponse } from '@moralisweb3/common-evm-utils'; +import { getBlockOperation, GetBlockRequest, GetBlockResponseAdapter, getDateToBlockOperation, GetDateToBlockRequest, GetDateToBlockResponseAdapter, GetBlockStatsOperationResponseJSON, GetBlockStatsOperation, GetBlockStatsOperationRequest, GetBlockStatsOperationResponse, getContractEventsOperation, GetContractEventsRequest, GetContractEventsResponseAdapter, getContractLogsOperation, GetContractLogsRequest, GetContractLogsResponseAdapter, getContractNFTsOperation, GetContractNFTsRequest, GetContractNFTsResponseAdapter, getMultipleNFTsOperation, GetMultipleNFTsRequest, GetMultipleNFTsResponseAdapter, getNFTContractMetadataOperation, GetNFTContractMetadataRequest, GetNFTContractMetadataResponseAdapter, getNFTContractTransfersOperation, GetNFTContractTransfersRequest, GetNFTContractTransfersResponseAdapter, getNFTLowestPriceOperation, GetNFTLowestPriceRequest, GetNFTLowestPriceResponseAdapter, getNFTMetadataOperation, GetNFTMetadataRequest, GetNFTMetadataResponseAdapter, getNFTOwnersOperation, GetNFTOwnersRequest, GetNFTOwnersResponseAdapter, getNFTTokenIdOwnersOperation, GetNFTTokenIdOwnersRequest, GetNFTTokenIdOwnersResponseAdapter, getNFTTransfersByBlockOperation, GetNFTTransfersByBlockRequest, GetNFTTransfersByBlockResponseAdapter, getNFTTransfersFromToBlockOperation, GetNFTTransfersFromToBlockRequest, GetNFTTransfersFromToBlockResponseAdapter, getNFTTransfersOperation, GetNFTTransfersRequest, GetNFTTransfersResponseAdapter, getWalletNFTCollectionsOperation, GetWalletNFTCollectionsRequest, GetWalletNFTCollectionsResponseAdapter, getWalletNFTsOperation, GetWalletNFTsRequest, GetWalletNFTsResponseAdapter, getWalletNFTTransfersOperation, GetWalletNFTTransfersRequest, GetWalletNFTTransfersResponseAdapter, reSyncMetadataOperation, ReSyncMetadataRequest, ReSyncMetadataResponseAdapter, syncNFTContractOperation, SyncNFTContractRequest, SyncNFTContractResponseAdapter, GetNFTTradesOperationResponseJSON, GetNFTTradesOperation, GetNFTTradesOperationRequest, GetNFTTradesOperationResponse, GetNFTContractSalePricesOperationResponseJSON, GetNFTContractSalePricesOperation, GetNFTContractSalePricesOperationRequest, GetNFTContractSalePricesOperationResponse, GetNFTSalePricesOperationResponseJSON, GetNFTSalePricesOperation, GetNFTSalePricesOperationRequest, GetNFTSalePricesOperationResponse, GetNFTCollectionStatsOperationResponseJSON, GetNFTCollectionStatsOperation, GetNFTCollectionStatsOperationRequest, GetNFTCollectionStatsOperationResponse, GetNFTTokenStatsOperationResponseJSON, GetNFTTokenStatsOperation, GetNFTTokenStatsOperationRequest, GetNFTTokenStatsOperationResponse, getInternalTransactionsOperation, GetInternalTransactionsRequest, GetInternalTransactionsResponseAdapter, getTransactionOperation, GetTransactionRequest, GetTransactionResponseAdapter, getTransactionVerboseOperation, GetTransactionVerboseRequest, GetTransactionVerboseResponseAdapter, getWalletTransactionsOperation, GetWalletTransactionsRequest, GetWalletTransactionsResponseAdapter, getWalletTransactionsVerboseOperation, GetWalletTransactionsVerboseRequest, GetWalletTransactionsVerboseResponseAdapter, getNativeBalanceOperation, GetNativeBalanceRequest, GetNativeBalanceResponseAdapter, getNativeBalancesForAddressesOperation, GetNativeBalancesForAddressesRequest, GetNativeBalancesForAddressesResponseAdapter, getPairAddressOperation, GetPairAddressRequest, GetPairAddressResponseAdapter, getPairReservesOperation, GetPairReservesRequest, GetPairReservesResponseAdapter, GetPairPriceOperationResponseJSON, GetPairPriceOperation, GetPairPriceOperationRequest, GetPairPriceOperationResponse, getTokenAllowanceOperation, GetTokenAllowanceRequest, GetTokenAllowanceResponseAdapter, getTokenMetadataBySymbolOperation, GetTokenMetadataBySymbolRequest, GetTokenMetadataBySymbolResponseAdapter, getTokenMetadataOperation, GetTokenMetadataRequest, GetTokenMetadataResponseAdapter, getTokenPriceOperation, GetTokenPriceRequest, GetTokenPriceResponseAdapter, getTokenTransfersOperation, GetTokenTransfersRequest, GetTokenTransfersResponseAdapter, getWalletTokenBalancesOperation, GetWalletTokenBalancesRequest, GetWalletTokenBalancesResponseAdapter, getWalletTokenTransfersOperation, GetWalletTokenTransfersRequest, GetWalletTokenTransfersResponseAdapter, GetMultipleTokenPricesOperationResponseJSON, GetMultipleTokenPricesOperation, GetMultipleTokenPricesOperationRequest, GetMultipleTokenPricesOperationBody, GetMultipleTokenPricesOperationResponse, GetTokenOwnersOperationResponseJSON, GetTokenOwnersOperation, GetTokenOwnersOperationRequest, GetTokenOwnersOperationResponse, GetTokenStatsOperationResponseJSON, GetTokenStatsOperation, GetTokenStatsOperationRequest, GetTokenStatsOperationResponse, GetTopProfitableWalletPerTokenOperationResponseJSON, GetTopProfitableWalletPerTokenOperation, GetTopProfitableWalletPerTokenOperationRequest, GetTopProfitableWalletPerTokenOperationResponse, resolveAddressOperation, ResolveAddressRequest, ResolveAddressResponseAdapter, resolveDomainOperation, ResolveDomainRequest, ResolveDomainResponseAdapter, resolveENSDomainOperation, ResolveENSDomainRequest, ResolveENSDomainResponseAdapter, ResolveAddressToDomainOperationResponseJSON, ResolveAddressToDomainOperation, ResolveAddressToDomainOperationRequest, ResolveAddressToDomainOperationResponse, runContractFunctionOperation, RunContractFunctionRequest, RunContractFunctionResponseAdapter, Web3ApiVersionOperationResponseJSON, Web3ApiVersionOperation, Web3ApiVersionOperationResponse, EndpointWeightsOperationResponseJSON, EndpointWeightsOperation, EndpointWeightsOperationResponse, ReviewContractsOperationResponseJSON, ReviewContractsOperation, ReviewContractsOperationRequest, ReviewContractsOperationBody, ReviewContractsOperationResponse, uploadFolderOperation, UploadFolderRequest, UploadFolderResponseAdapter, GetWalletHistoryOperationResponseJSON, GetWalletHistoryOperation, GetWalletHistoryOperationRequest, GetWalletHistoryOperationResponse, GetWalletTokenBalancesPriceOperationResponseJSON, GetWalletTokenBalancesPriceOperation, GetWalletTokenBalancesPriceOperationRequest, GetWalletTokenBalancesPriceOperationResponse, GetWalletNetWorthOperationResponseJSON, GetWalletNetWorthOperation, GetWalletNetWorthOperationRequest, GetWalletNetWorthOperationResponse, GetDefiSummaryOperationResponseJSON, GetDefiSummaryOperation, GetDefiSummaryOperationRequest, GetDefiSummaryOperationResponse, GetDefiPositionsByProtocolOperationResponseJSON, GetDefiPositionsByProtocolOperation, GetDefiPositionsByProtocolOperationRequest, GetDefiPositionsByProtocolOperationResponse, GetDefiPositionsSummaryOperationResponseJSON, GetDefiPositionsSummaryOperation, GetDefiPositionsSummaryOperationRequest, GetDefiPositionsSummaryOperationResponse, GetWalletActiveChainsOperationResponseJSON, GetWalletActiveChainsOperation, GetWalletActiveChainsOperationRequest, GetWalletActiveChainsOperationResponse, GetWalletStatsOperationResponseJSON, GetWalletStatsOperation, GetWalletStatsOperationRequest, GetWalletStatsOperationResponse, GetWalletProfitabilitySummaryOperationResponseJSON, GetWalletProfitabilitySummaryOperation, GetWalletProfitabilitySummaryOperationRequest, GetWalletProfitabilitySummaryOperationResponse, GetWalletProfitabilityOperationResponseJSON, GetWalletProfitabilityOperation, GetWalletProfitabilityOperationRequest, GetWalletProfitabilityOperationResponse, GetTopERC20TokensByMarketCapOperationResponseJSON, GetTopERC20TokensByMarketCapOperation, GetTopERC20TokensByMarketCapOperationResponse, GetTopERC20TokensByPriceMoversOperationResponseJSON, GetTopERC20TokensByPriceMoversOperation, GetTopERC20TokensByPriceMoversOperationResponse, GetTopNFTCollectionsByMarketCapOperationResponseJSON, GetTopNFTCollectionsByMarketCapOperation, GetTopNFTCollectionsByMarketCapOperationResponse, GetHottestNFTCollectionsByTradingVolumeOperationResponseJSON, GetHottestNFTCollectionsByTradingVolumeOperation, GetHottestNFTCollectionsByTradingVolumeOperationResponse, GetTopCryptoCurrenciesByMarketCapOperationResponseJSON, GetTopCryptoCurrenciesByMarketCapOperation, GetTopCryptoCurrenciesByMarketCapOperationResponse, GetTopCryptoCurrenciesByTradingVolumeOperationResponseJSON, GetTopCryptoCurrenciesByTradingVolumeOperation, GetTopCryptoCurrenciesByTradingVolumeOperationResponse } from '@moralisweb3/common-evm-utils'; import { NullableOperationResolver, OperationResolver, OperationV3Resolver, PaginatedOperationResolver, PaginatedResponseV3Adapter, PaginatedOperationV3Resolver } from '@moralisweb3/api-utils'; import { ApiModule, ResponseAdapter } from '@moralisweb3/common-core'; export abstract class ClientEvmApi extends ApiModule { @@ -168,6 +168,9 @@ export abstract class ClientEvmApi extends ApiModule { getTokenStats: (request: GetTokenStatsOperationRequest): Promise> => { return new OperationV3Resolver(GetTokenStatsOperation, this.baseUrl, this.core).fetch(request, null); }, + getTopProfitableWalletPerToken: (request: GetTopProfitableWalletPerTokenOperationRequest): Promise> => { + return new OperationV3Resolver(GetTopProfitableWalletPerTokenOperation, this.baseUrl, this.core).fetch(request, null); + }, }; @@ -235,6 +238,12 @@ export abstract class ClientEvmApi extends ApiModule { getWalletStats: (request: GetWalletStatsOperationRequest): Promise> => { return new OperationV3Resolver(GetWalletStatsOperation, this.baseUrl, this.core).fetch(request, null); }, + getWalletProfitabilitySummary: (request: GetWalletProfitabilitySummaryOperationRequest): Promise> => { + return new OperationV3Resolver(GetWalletProfitabilitySummaryOperation, this.baseUrl, this.core).fetch(request, null); + }, + getWalletProfitability: (request: GetWalletProfitabilityOperationRequest): Promise> => { + return new OperationV3Resolver(GetWalletProfitabilityOperation, this.baseUrl, this.core).fetch(request, null); + }, };