diff --git a/.changeset/rotten-months-care.md b/.changeset/rotten-months-care.md new file mode 100644 index 0000000000..e3c71d86ad --- /dev/null +++ b/.changeset/rotten-months-care.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': minor +'@moralisweb3/evm-api': minor +'moralis': minor +--- + +Update SDK to reflect minor changes in the swagger file. diff --git a/packages/common/evmUtils/src/generated/client/abstractClient.ts b/packages/common/evmUtils/src/generated/client/abstractClient.ts index 41ce18f0d4..2bbdca9472 100644 --- a/packages/common/evmUtils/src/generated/client/abstractClient.ts +++ b/packages/common/evmUtils/src/generated/client/abstractClient.ts @@ -294,6 +294,7 @@ export abstract class AbstractClient { * @param request Request with parameters. * @param {Object} [request.chain] The chain to query (optional) * @param {Object} [request.include] If the result should contain the 24hr percent change (optional) + * @param {Number} [request.maxTokenInactivity] Exclude tokens inactive for more than the given amount of days (optional) * @param body Request body. * @param {Object[]} body.tokens The tokens to be fetched * @returns {Object[]} Response for the request. @@ -339,7 +340,7 @@ export abstract class AbstractClient { * @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 {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) * @returns {Object} Response for the request. */ @@ -410,7 +411,6 @@ export abstract class AbstractClient { * * If 'to_date' and 'to_block' are provided, 'to_block' will be used. (optional) * @param {Boolean} [request.includeInternalTransactions] If the result should contain the internal transactions. (optional) * @param {Boolean} [request.includeInputData] Set the input data from the result (optional) - * @param {Boolean} [request.includeLogsData] Set the logs data from the result (optional) * @param {Boolean} [request.nftMetadata] If the result should contain the nft metadata. (optional) * @param {String} [request.cursor] The cursor returned in the previous response (used for getting the next page). (optional) * @param {Object} [request.order] The order of the result, in ascending (ASC) or descending (DESC) (optional) @@ -435,6 +435,7 @@ export abstract class AbstractClient { * @param {String} [request.cursor] The cursor returned in the previous response (used for getting the next page). (optional) * @param {Number} [request.limit] The desired page size of the result. (optional) * @param {Boolean} [request.excludeNative] Exclude native balance from the result (optional) + * @param {Number} [request.maxTokenInactivity] Exclude tokens inactive for more than the given amount of days (optional) * @returns {Object} Response for the request. */ getWalletTokenBalancesPrice: this.createEndpoint< @@ -450,6 +451,7 @@ export abstract class AbstractClient { * @param {Object[]} [request.chains] The chains to query (optional) * @param {Boolean} [request.excludeSpam] Exclude spam tokens from the result (optional) * @param {Boolean} [request.excludeUnverifiedContracts] Exclude unverified contracts from the result (optional) + * @param {Number} [request.maxTokenInactivity] Exclude tokens inactive for more than the given amount of days (optional) * @returns {Object} Response for the request. */ getWalletNetWorth: this.createEndpoint< diff --git a/packages/common/evmUtils/src/generated/operations/GetMultipleTokenPricesOperation.ts b/packages/common/evmUtils/src/generated/operations/GetMultipleTokenPricesOperation.ts index 32180fff20..6fb195a1df 100644 --- a/packages/common/evmUtils/src/generated/operations/GetMultipleTokenPricesOperation.ts +++ b/packages/common/evmUtils/src/generated/operations/GetMultipleTokenPricesOperation.ts @@ -6,6 +6,7 @@ import { EvmGetMultipleTokenPricesDto, EvmGetMultipleTokenPricesDtoInput, EvmGet // request parameters: // - chain ($ref: #/components/schemas/chainList) // - include ($ref: #/paths/~1erc20~1prices/post/parameters/1/schema) +// - max_token_inactivity ($ref: #/paths/~1erc20~1prices/post/parameters/2/schema) export interface GetMultipleTokenPricesOperationRequest { /** @@ -16,11 +17,16 @@ export interface GetMultipleTokenPricesOperationRequest { * @description If the result should contain the 24hr percent change */ readonly include?: EvmGetMultipleTokenPricesIncludeEnumInput | EvmGetMultipleTokenPricesIncludeEnumValue; + /** + * @description Exclude tokens inactive for more than the given amount of days + */ + readonly maxTokenInactivity?: number; } export interface GetMultipleTokenPricesOperationRequestJSON { readonly chain?: EvmChainJSON; readonly include?: EvmGetMultipleTokenPricesIncludeEnumJSON; + readonly max_token_inactivity?: number; } export type GetMultipleTokenPricesOperationResponse = EvmErc20Price[]; @@ -33,7 +39,7 @@ export const GetMultipleTokenPricesOperation = { groupName: "token", httpMethod: "post", routePattern: "/erc20/prices", - parameterNames: ["chain","include"], + parameterNames: ["chain","include","max_token_inactivity"], hasResponse: true, hasBody: true, @@ -44,9 +50,11 @@ export const GetMultipleTokenPricesOperation = { serializeRequest(request: GetMultipleTokenPricesOperationRequest): GetMultipleTokenPricesOperationRequestJSON { const chain = request.chain ? EvmChain.create(request.chain) : undefined; const include = request.include ? EvmGetMultipleTokenPricesIncludeEnum.create(request.include) : undefined; + const maxTokenInactivity = request.maxTokenInactivity; return { chain: chain ? chain.toJSON() : undefined, include: include ? include : undefined, + max_token_inactivity: maxTokenInactivity, }; }, diff --git a/packages/common/evmUtils/src/generated/operations/GetTopProfitableWalletPerTokenOperation.ts b/packages/common/evmUtils/src/generated/operations/GetTopProfitableWalletPerTokenOperation.ts index aae4a44908..47620a5f65 100644 --- a/packages/common/evmUtils/src/generated/operations/GetTopProfitableWalletPerTokenOperation.ts +++ b/packages/common/evmUtils/src/generated/operations/GetTopProfitableWalletPerTokenOperation.ts @@ -12,7 +12,7 @@ export interface GetTopProfitableWalletPerTokenOperationRequest { */ readonly address: EvmAddressInput | EvmAddress; /** - * @description Timeframe in days for which profitability is calculated, can be 'all', '7d' or '30d' + * @description Timeframe in days for which profitability is calculated, Options include 'all', '7', '30', '60', '90' default is 'all'. */ readonly days?: string; /** diff --git a/packages/common/evmUtils/src/generated/operations/GetWalletHistoryOperation.ts b/packages/common/evmUtils/src/generated/operations/GetWalletHistoryOperation.ts index 9df7e3c172..951517d984 100644 --- a/packages/common/evmUtils/src/generated/operations/GetWalletHistoryOperation.ts +++ b/packages/common/evmUtils/src/generated/operations/GetWalletHistoryOperation.ts @@ -11,11 +11,10 @@ import { EvmWalletHistory, EvmWalletHistoryJSON } from '../types/EvmWalletHistor // - address ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/5/schema) // - include_internal_transactions ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/6/schema) // - include_input_data ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/7/schema) -// - include_logs_data ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/8/schema) -// - nft_metadata ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/9/schema) -// - cursor ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/10/schema) +// - nft_metadata ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/8/schema) +// - cursor ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/9/schema) // - order ($ref: #/components/schemas/orderList) -// - limit ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/12/schema) +// - limit ($ref: #/paths/~1wallets~1{address}~1history/get/parameters/11/schema) export interface GetWalletHistoryOperationRequest { /** @@ -58,10 +57,6 @@ export interface GetWalletHistoryOperationRequest { * @description Set the input data from the result */ readonly includeInputData?: boolean; - /** - * @description Set the logs data from the result - */ - readonly includeLogsData?: boolean; /** * @description If the result should contain the nft metadata. */ @@ -89,7 +84,6 @@ export interface GetWalletHistoryOperationRequestJSON { readonly address: EvmAddressJSON; readonly include_internal_transactions?: boolean; readonly include_input_data?: boolean; - readonly include_logs_data?: boolean; readonly nft_metadata?: boolean; readonly cursor?: string; readonly order?: EvmOrderListJSON; @@ -104,7 +98,7 @@ export const GetWalletHistoryOperation = { groupName: "wallets", httpMethod: "get", routePattern: "/wallets/{address}/history", - parameterNames: ["chain","from_block","to_block","from_date","to_date","address","include_internal_transactions","include_input_data","include_logs_data","nft_metadata","cursor","order","limit"], + parameterNames: ["chain","from_block","to_block","from_date","to_date","address","include_internal_transactions","include_input_data","nft_metadata","cursor","order","limit"], hasResponse: true, hasBody: false, @@ -121,7 +115,6 @@ export const GetWalletHistoryOperation = { const address = EvmAddress.create(request.address); const includeInternalTransactions = request.includeInternalTransactions; const includeInputData = request.includeInputData; - const includeLogsData = request.includeLogsData; const nftMetadata = request.nftMetadata; const cursor = request.cursor; const order = request.order ? EvmOrderList.create(request.order) : undefined; @@ -135,7 +128,6 @@ export const GetWalletHistoryOperation = { address: address.toJSON(), include_internal_transactions: includeInternalTransactions, include_input_data: includeInputData, - include_logs_data: includeLogsData, nft_metadata: nftMetadata, cursor: cursor, order: order ? order : undefined, diff --git a/packages/common/evmUtils/src/generated/operations/GetWalletNetWorthOperation.ts b/packages/common/evmUtils/src/generated/operations/GetWalletNetWorthOperation.ts index ae35f93dcb..243d90fcd3 100644 --- a/packages/common/evmUtils/src/generated/operations/GetWalletNetWorthOperation.ts +++ b/packages/common/evmUtils/src/generated/operations/GetWalletNetWorthOperation.ts @@ -6,6 +6,7 @@ import { EvmNetWorthResult, EvmNetWorthResultJSON } from '../types/EvmNetWorthRe // - address ($ref: #/paths/~1wallets~1{address}~1net-worth/get/parameters/1/schema) // - exclude_spam ($ref: #/paths/~1wallets~1{address}~1net-worth/get/parameters/2/schema) // - exclude_unverified_contracts ($ref: #/paths/~1wallets~1{address}~1net-worth/get/parameters/3/schema) +// - max_token_inactivity ($ref: #/paths/~1wallets~1{address}~1net-worth/get/parameters/4/schema) export interface GetWalletNetWorthOperationRequest { /** @@ -24,6 +25,10 @@ export interface GetWalletNetWorthOperationRequest { * @description Exclude unverified contracts from the result */ readonly excludeUnverifiedContracts?: boolean; + /** + * @description Exclude tokens inactive for more than the given amount of days + */ + readonly maxTokenInactivity?: number; } export interface GetWalletNetWorthOperationRequestJSON { @@ -31,6 +36,7 @@ export interface GetWalletNetWorthOperationRequestJSON { readonly address: EvmAddressJSON; readonly exclude_spam?: boolean; readonly exclude_unverified_contracts?: boolean; + readonly max_token_inactivity?: number; } export type GetWalletNetWorthOperationResponse = EvmNetWorthResult; @@ -41,7 +47,7 @@ export const GetWalletNetWorthOperation = { groupName: "wallets", httpMethod: "get", routePattern: "/wallets/{address}/net-worth", - parameterNames: ["chains","address","exclude_spam","exclude_unverified_contracts"], + parameterNames: ["chains","address","exclude_spam","exclude_unverified_contracts","max_token_inactivity"], hasResponse: true, hasBody: false, @@ -54,11 +60,13 @@ export const GetWalletNetWorthOperation = { const address = EvmAddress.create(request.address); const excludeSpam = request.excludeSpam; const excludeUnverifiedContracts = request.excludeUnverifiedContracts; + const maxTokenInactivity = request.maxTokenInactivity; return { chains: chains ? chains.map((item) => item.toJSON()) : undefined, address: address.toJSON(), exclude_spam: excludeSpam, exclude_unverified_contracts: excludeUnverifiedContracts, + max_token_inactivity: maxTokenInactivity, }; }, diff --git a/packages/common/evmUtils/src/generated/operations/GetWalletTokenBalancesPriceOperation.ts b/packages/common/evmUtils/src/generated/operations/GetWalletTokenBalancesPriceOperation.ts index 3f25e40768..b1d745e49a 100644 --- a/packages/common/evmUtils/src/generated/operations/GetWalletTokenBalancesPriceOperation.ts +++ b/packages/common/evmUtils/src/generated/operations/GetWalletTokenBalancesPriceOperation.ts @@ -11,6 +11,7 @@ import { EvmErc20TokenBalanceWithPriceResult, EvmErc20TokenBalanceWithPriceResul // - cursor ($ref: #/paths/~1wallets~1{address}~1tokens/get/parameters/6/schema) // - limit ($ref: #/paths/~1wallets~1{address}~1tokens/get/parameters/7/schema) // - exclude_native ($ref: #/paths/~1wallets~1{address}~1tokens/get/parameters/8/schema) +// - max_token_inactivity ($ref: #/paths/~1wallets~1{address}~1tokens/get/parameters/9/schema) export interface GetWalletTokenBalancesPriceOperationRequest { /** @@ -49,6 +50,10 @@ export interface GetWalletTokenBalancesPriceOperationRequest { * @description Exclude native balance from the result */ readonly excludeNative?: boolean; + /** + * @description Exclude tokens inactive for more than the given amount of days + */ + readonly maxTokenInactivity?: number; } export interface GetWalletTokenBalancesPriceOperationRequestJSON { @@ -61,6 +66,7 @@ export interface GetWalletTokenBalancesPriceOperationRequestJSON { readonly cursor?: string; readonly limit?: number; readonly exclude_native?: boolean; + readonly max_token_inactivity?: number; } export type GetWalletTokenBalancesPriceOperationResponse = EvmErc20TokenBalanceWithPriceResult; @@ -71,7 +77,7 @@ export const GetWalletTokenBalancesPriceOperation = { groupName: "wallets", httpMethod: "get", routePattern: "/wallets/{address}/tokens", - parameterNames: ["chain","address","to_block","token_addresses","exclude_spam","exclude_unverified_contracts","cursor","limit","exclude_native"], + parameterNames: ["chain","address","to_block","token_addresses","exclude_spam","exclude_unverified_contracts","cursor","limit","exclude_native","max_token_inactivity"], hasResponse: true, hasBody: false, @@ -89,6 +95,7 @@ export const GetWalletTokenBalancesPriceOperation = { const cursor = request.cursor; const limit = request.limit; const excludeNative = request.excludeNative; + const maxTokenInactivity = request.maxTokenInactivity; return { chain: chain ? chain.toJSON() : undefined, address: address.toJSON(), @@ -99,6 +106,7 @@ export const GetWalletTokenBalancesPriceOperation = { cursor: cursor, limit: limit, exclude_native: excludeNative, + max_token_inactivity: maxTokenInactivity, }; }, diff --git a/packages/common/evmUtils/src/generated/types/EvmDecodedEvent.ts b/packages/common/evmUtils/src/generated/types/EvmDecodedEvent.ts new file mode 100644 index 0000000000..3c890bb4b2 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmDecodedEvent.ts @@ -0,0 +1,63 @@ +import { EvmDecodedEventParamsItem, EvmDecodedEventParamsItemInput, EvmDecodedEventParamsItemJSON } from '../types/EvmDecodedEventParamsItem'; + +// $ref: #/components/schemas/decodedEvent +// type: decodedEvent +// properties: +// - signature ($ref: #/components/schemas/decodedEvent/properties/signature) +// - label ($ref: #/components/schemas/decodedEvent/properties/label) +// - type ($ref: #/components/schemas/decodedEvent/properties/type) +// - params ($ref: #/components/schemas/decodedEvent/properties/params/items) + +export interface EvmDecodedEventJSON { + readonly signature?: string; + readonly label?: string; + readonly type?: string; + readonly params?: EvmDecodedEventParamsItemJSON[]; +} + +export interface EvmDecodedEventInput { + readonly signature?: string; + readonly label?: string; + readonly type?: string; + readonly params?: EvmDecodedEventParamsItemInput[] | EvmDecodedEventParamsItem[]; +} + +export class EvmDecodedEvent { + public static create(input: EvmDecodedEventInput | EvmDecodedEvent): EvmDecodedEvent { + if (input instanceof EvmDecodedEvent) { + return input; + } + return new EvmDecodedEvent(input); + } + + public static fromJSON(json: EvmDecodedEventJSON): EvmDecodedEvent { + const input: EvmDecodedEventInput = { + signature: json.signature, + label: json.label, + type: json.type, + params: json.params ? json.params.map((item) => EvmDecodedEventParamsItem.fromJSON(item)) : undefined, + }; + return EvmDecodedEvent.create(input); + } + + public readonly signature?: string; + public readonly label?: string; + public readonly type?: string; + public readonly params?: EvmDecodedEventParamsItem[]; + + private constructor(input: EvmDecodedEventInput) { + this.signature = input.signature; + this.label = input.label; + this.type = input.type; + this.params = input.params ? input.params.map((item) => EvmDecodedEventParamsItem.create(item)) : undefined; + } + + public toJSON(): EvmDecodedEventJSON { + return { + signature: this.signature, + label: this.label, + type: this.type, + params: this.params ? this.params.map((item) => item.toJSON()) : undefined, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmDecodedEventParamsItem.ts b/packages/common/evmUtils/src/generated/types/EvmDecodedEventParamsItem.ts new file mode 100644 index 0000000000..f87331bfac --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmDecodedEventParamsItem.ts @@ -0,0 +1,54 @@ +// $ref: #/components/schemas/decodedEvent/properties/params/items +// type: decodedEvent_params_Item +// properties: +// - name ($ref: #/components/schemas/decodedEvent/properties/params/items/properties/name) +// - value ($ref: #/components/schemas/decodedEvent/properties/params/items/properties/value) +// - type ($ref: #/components/schemas/decodedEvent/properties/params/items/properties/type) + +export interface EvmDecodedEventParamsItemJSON { + readonly name?: string; + readonly value?: string; + readonly type?: string; +} + +export interface EvmDecodedEventParamsItemInput { + readonly name?: string; + readonly value?: string; + readonly type?: string; +} + +export class EvmDecodedEventParamsItem { + public static create(input: EvmDecodedEventParamsItemInput | EvmDecodedEventParamsItem): EvmDecodedEventParamsItem { + if (input instanceof EvmDecodedEventParamsItem) { + return input; + } + return new EvmDecodedEventParamsItem(input); + } + + public static fromJSON(json: EvmDecodedEventParamsItemJSON): EvmDecodedEventParamsItem { + const input: EvmDecodedEventParamsItemInput = { + name: json.name, + value: json.value, + type: json.type, + }; + return EvmDecodedEventParamsItem.create(input); + } + + public readonly name?: string; + public readonly value?: string; + public readonly type?: string; + + private constructor(input: EvmDecodedEventParamsItemInput) { + this.name = input.name; + this.value = input.value; + this.type = input.type; + } + + public toJSON(): EvmDecodedEventParamsItemJSON { + return { + name: this.name, + value: this.value, + type: this.type, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts b/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts index 2601a44270..eb89b2129d 100644 --- a/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts +++ b/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts @@ -30,6 +30,8 @@ import { EvmDefiPositionDetailsNftMetadata, EvmDefiPositionDetailsNftMetadataVal // - no_price_available ($ref: #/components/schemas/defiPositionDetails/properties/no_price_available) // - shares_in_strategy ($ref: #/components/schemas/defiPositionDetails/properties/shares_in_strategy) // - strategy_address ($ref: #/components/schemas/defiPositionDetails/properties/strategy_address) +// - base_type ($ref: #/components/schemas/defiPositionDetails/properties/base_type) +// - health_factor ($ref: #/components/schemas/defiPositionDetails/properties/health_factor) export interface EvmDefiPositionDetailsJSON { readonly fee_tier?: number; @@ -59,6 +61,8 @@ export interface EvmDefiPositionDetailsJSON { readonly no_price_available?: boolean; readonly shares_in_strategy?: string; readonly strategy_address?: string; + readonly base_type?: string; + readonly health_factor?: number; } export interface EvmDefiPositionDetailsInput { @@ -89,6 +93,8 @@ export interface EvmDefiPositionDetailsInput { readonly noPriceAvailable?: boolean; readonly sharesInStrategy?: string; readonly strategyAddress?: string; + readonly baseType?: string; + readonly healthFactor?: number; } export class EvmDefiPositionDetails { @@ -128,6 +134,8 @@ export class EvmDefiPositionDetails { noPriceAvailable: json.no_price_available, sharesInStrategy: json.shares_in_strategy, strategyAddress: json.strategy_address, + baseType: json.base_type, + healthFactor: json.health_factor, }; return EvmDefiPositionDetails.create(input); } @@ -240,6 +248,14 @@ export class EvmDefiPositionDetails { * @description The address of the strategy */ public readonly strategyAddress?: string; + /** + * @description The base type of the position + */ + public readonly baseType?: string; + /** + * @description The health factor of the position + */ + public readonly healthFactor?: number; private constructor(input: EvmDefiPositionDetailsInput) { this.feeTier = input.feeTier; @@ -269,6 +285,8 @@ export class EvmDefiPositionDetails { this.noPriceAvailable = input.noPriceAvailable; this.sharesInStrategy = input.sharesInStrategy; this.strategyAddress = input.strategyAddress; + this.baseType = input.baseType; + this.healthFactor = input.healthFactor; } public toJSON(): EvmDefiPositionDetailsJSON { @@ -300,6 +318,8 @@ export class EvmDefiPositionDetails { no_price_available: this.noPriceAvailable, shares_in_strategy: this.sharesInStrategy, strategy_address: this.strategyAddress, + base_type: this.baseType, + health_factor: this.healthFactor, } } } diff --git a/packages/common/evmUtils/src/generated/types/EvmDefiProtocolList.ts b/packages/common/evmUtils/src/generated/types/EvmDefiProtocolList.ts index 5eabb7f20e..75f990d657 100644 --- a/packages/common/evmUtils/src/generated/types/EvmDefiProtocolList.ts +++ b/packages/common/evmUtils/src/generated/types/EvmDefiProtocolList.ts @@ -1,9 +1,9 @@ // $ref: #/components/schemas/defiProtocolList // typeName: defiProtocolList -export type EvmDefiProtocolListJSON = "uniswap-v2" | "uniswap-v3" | "pancakeswap-v2" | "pancakeswap-v3" | "quickswap-v2" | "sushiswap-v2" | "aave-v2" | "aave-v3" | "fraxswap-v1" | "fraxswap-v2" | "lido" | "makerdao" | "eigenlayer"; -export type EvmDefiProtocolListInput = "uniswap-v2" | "uniswap-v3" | "pancakeswap-v2" | "pancakeswap-v3" | "quickswap-v2" | "sushiswap-v2" | "aave-v2" | "aave-v3" | "fraxswap-v1" | "fraxswap-v2" | "lido" | "makerdao" | "eigenlayer"; -export type EvmDefiProtocolListValue = "uniswap-v2" | "uniswap-v3" | "pancakeswap-v2" | "pancakeswap-v3" | "quickswap-v2" | "sushiswap-v2" | "aave-v2" | "aave-v3" | "fraxswap-v1" | "fraxswap-v2" | "lido" | "makerdao" | "eigenlayer"; +export type EvmDefiProtocolListJSON = "uniswap-v2" | "uniswap-v3" | "pancakeswap-v2" | "pancakeswap-v3" | "quickswap-v2" | "sushiswap-v2" | "aave-v2" | "aave-v3" | "fraxswap-v1" | "fraxswap-v2" | "lido" | "makerdao" | "eigenlayer" | "pendle" | "etherfi" | "rocketpool" | "sparkfi"; +export type EvmDefiProtocolListInput = "uniswap-v2" | "uniswap-v3" | "pancakeswap-v2" | "pancakeswap-v3" | "quickswap-v2" | "sushiswap-v2" | "aave-v2" | "aave-v3" | "fraxswap-v1" | "fraxswap-v2" | "lido" | "makerdao" | "eigenlayer" | "pendle" | "etherfi" | "rocketpool" | "sparkfi"; +export type EvmDefiProtocolListValue = "uniswap-v2" | "uniswap-v3" | "pancakeswap-v2" | "pancakeswap-v3" | "quickswap-v2" | "sushiswap-v2" | "aave-v2" | "aave-v3" | "fraxswap-v1" | "fraxswap-v2" | "lido" | "makerdao" | "eigenlayer" | "pendle" | "etherfi" | "rocketpool" | "sparkfi"; export abstract class EvmDefiProtocolList { public static create(input: EvmDefiProtocolListInput | EvmDefiProtocolListValue): EvmDefiProtocolListValue { diff --git a/packages/common/evmUtils/src/generated/types/EvmLog.ts b/packages/common/evmUtils/src/generated/types/EvmLogVerbose.ts similarity index 59% rename from packages/common/evmUtils/src/generated/types/EvmLog.ts rename to packages/common/evmUtils/src/generated/types/EvmLogVerbose.ts index a6739d51bb..8c8e606745 100644 --- a/packages/common/evmUtils/src/generated/types/EvmLog.ts +++ b/packages/common/evmUtils/src/generated/types/EvmLogVerbose.ts @@ -1,23 +1,25 @@ import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; import { BigNumber, BigNumberInput, BigNumberJSON } from '@moralisweb3/common-core'; +import { EvmDecodedEvent, EvmDecodedEventInput, EvmDecodedEventJSON } from '../types/EvmDecodedEvent'; -// $ref: #/components/schemas/log -// type: log +// $ref: #/components/schemas/logVerbose +// type: logVerbose // properties: -// - log_index ($ref: #/components/schemas/log/properties/log_index) -// - transaction_hash ($ref: #/components/schemas/log/properties/transaction_hash) -// - transaction_index ($ref: #/components/schemas/log/properties/transaction_index) -// - address ($ref: #/components/schemas/log/properties/address) -// - data ($ref: #/components/schemas/log/properties/data) -// - topic0 ($ref: #/components/schemas/log/properties/topic0) -// - topic1 ($ref: #/components/schemas/log/properties/topic1) -// - topic2 ($ref: #/components/schemas/log/properties/topic2) -// - topic3 ($ref: #/components/schemas/log/properties/topic3) -// - block_timestamp ($ref: #/components/schemas/log/properties/block_timestamp) -// - block_number ($ref: #/components/schemas/log/properties/block_number) -// - block_hash ($ref: #/components/schemas/log/properties/block_hash) +// - log_index ($ref: #/components/schemas/logVerbose/properties/log_index) +// - transaction_hash ($ref: #/components/schemas/logVerbose/properties/transaction_hash) +// - transaction_index ($ref: #/components/schemas/logVerbose/properties/transaction_index) +// - address ($ref: #/components/schemas/logVerbose/properties/address) +// - data ($ref: #/components/schemas/logVerbose/properties/data) +// - topic0 ($ref: #/components/schemas/logVerbose/properties/topic0) +// - topic1 ($ref: #/components/schemas/logVerbose/properties/topic1) +// - topic2 ($ref: #/components/schemas/logVerbose/properties/topic2) +// - topic3 ($ref: #/components/schemas/logVerbose/properties/topic3) +// - block_timestamp ($ref: #/components/schemas/logVerbose/properties/block_timestamp) +// - block_number ($ref: #/components/schemas/logVerbose/properties/block_number) +// - block_hash ($ref: #/components/schemas/logVerbose/properties/block_hash) +// - decoded_event ($ref: #/components/schemas/decodedEvent) -export interface EvmLogJSON { +export interface EvmLogVerboseJSON { readonly log_index: string; readonly transaction_hash: string; readonly transaction_index: string; @@ -30,9 +32,10 @@ export interface EvmLogJSON { readonly block_timestamp: string; readonly block_number: BigNumberJSON; readonly block_hash: string; + readonly decoded_event: EvmDecodedEventJSON; } -export interface EvmLogInput { +export interface EvmLogVerboseInput { readonly logIndex: number; readonly transactionHash: string; readonly transactionIndex: number; @@ -45,18 +48,19 @@ export interface EvmLogInput { readonly blockTimestamp: string; readonly blockNumber: BigNumberInput | BigNumber; readonly blockHash: string; + readonly decodedEvent: EvmDecodedEventInput | EvmDecodedEvent; } -export class EvmLog { - public static create(input: EvmLogInput | EvmLog): EvmLog { - if (input instanceof EvmLog) { +export class EvmLogVerbose { + public static create(input: EvmLogVerboseInput | EvmLogVerbose): EvmLogVerbose { + if (input instanceof EvmLogVerbose) { return input; } - return new EvmLog(input); + return new EvmLogVerbose(input); } - public static fromJSON(json: EvmLogJSON): EvmLog { - const input: EvmLogInput = { + public static fromJSON(json: EvmLogVerboseJSON): EvmLogVerbose { + const input: EvmLogVerboseInput = { logIndex: Number(json.log_index), transactionHash: json.transaction_hash, transactionIndex: Number(json.transaction_index), @@ -69,8 +73,9 @@ export class EvmLog { blockTimestamp: json.block_timestamp, blockNumber: BigNumber.fromJSON(json.block_number), blockHash: json.block_hash, + decodedEvent: EvmDecodedEvent.fromJSON(json.decoded_event), }; - return EvmLog.create(input); + return EvmLogVerbose.create(input); } public readonly logIndex: number; @@ -103,8 +108,12 @@ export class EvmLog { * @description The hash of the block */ public readonly blockHash: string; + /** + * @description The decoded data of the log + */ + public readonly decodedEvent: EvmDecodedEvent; - private constructor(input: EvmLogInput) { + private constructor(input: EvmLogVerboseInput) { this.logIndex = input.logIndex; this.transactionHash = input.transactionHash; this.transactionIndex = input.transactionIndex; @@ -117,9 +126,10 @@ export class EvmLog { this.blockTimestamp = input.blockTimestamp; this.blockNumber = BigNumber.create(input.blockNumber); this.blockHash = input.blockHash; + this.decodedEvent = EvmDecodedEvent.create(input.decodedEvent); } - public toJSON(): EvmLogJSON { + public toJSON(): EvmLogVerboseJSON { return { log_index: String(this.logIndex), transaction_hash: this.transactionHash, @@ -133,6 +143,7 @@ export class EvmLog { block_timestamp: this.blockTimestamp, block_number: this.blockNumber.toJSON(), block_hash: this.blockHash, + decoded_event: this.decodedEvent.toJSON(), } } } diff --git a/packages/common/evmUtils/src/generated/types/EvmNativeTransfer.ts b/packages/common/evmUtils/src/generated/types/EvmNativeTransfer.ts index 9f93ebc2d1..8b2a551348 100644 --- a/packages/common/evmUtils/src/generated/types/EvmNativeTransfer.ts +++ b/packages/common/evmUtils/src/generated/types/EvmNativeTransfer.ts @@ -3,8 +3,12 @@ import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; // $ref: #/components/schemas/native_transfer // type: native_transfer // properties: +// - from_address_entity ($ref: #/components/schemas/native_transfer/properties/from_address_entity) +// - from_address_entity_logo ($ref: #/components/schemas/native_transfer/properties/from_address_entity_logo) // - from_address ($ref: #/components/schemas/native_transfer/properties/from_address) // - from_address_label ($ref: #/components/schemas/native_transfer/properties/from_address_label) +// - to_address_entity ($ref: #/components/schemas/native_transfer/properties/to_address_entity) +// - to_address_entity_logo ($ref: #/components/schemas/native_transfer/properties/to_address_entity_logo) // - to_address ($ref: #/components/schemas/native_transfer/properties/to_address) // - to_address_label ($ref: #/components/schemas/native_transfer/properties/to_address_label) // - value ($ref: #/components/schemas/native_transfer/properties/value) @@ -15,8 +19,12 @@ import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; // - token_logo ($ref: #/components/schemas/native_transfer/properties/token_logo) export interface EvmNativeTransferJSON { + readonly from_address_entity?: string; + readonly from_address_entity_logo?: string; readonly from_address: EvmAddressJSON; readonly from_address_label?: string; + readonly to_address_entity?: string; + readonly to_address_entity_logo?: string; readonly to_address?: EvmAddressJSON; readonly to_address_label?: string; readonly value: string; @@ -28,8 +36,12 @@ export interface EvmNativeTransferJSON { } export interface EvmNativeTransferInput { + readonly fromAddressEntity?: string; + readonly fromAddressEntityLogo?: string; readonly fromAddress: EvmAddressInput | EvmAddress; readonly fromAddressLabel?: string; + readonly toAddressEntity?: string; + readonly toAddressEntityLogo?: string; readonly toAddress?: EvmAddressInput | EvmAddress; readonly toAddressLabel?: string; readonly value: string; @@ -50,8 +62,12 @@ export class EvmNativeTransfer { public static fromJSON(json: EvmNativeTransferJSON): EvmNativeTransfer { const input: EvmNativeTransferInput = { + fromAddressEntity: json.from_address_entity, + fromAddressEntityLogo: json.from_address_entity_logo, fromAddress: EvmAddress.fromJSON(json.from_address), fromAddressLabel: json.from_address_label, + toAddressEntity: json.to_address_entity, + toAddressEntityLogo: json.to_address_entity_logo, toAddress: json.to_address ? EvmAddress.fromJSON(json.to_address) : undefined, toAddressLabel: json.to_address_label, value: json.value, @@ -64,6 +80,14 @@ export class EvmNativeTransfer { return EvmNativeTransfer.create(input); } + /** + * @description The from address entity + */ + public readonly fromAddressEntity?: string; + /** + * @description The logo of the from address entity + */ + public readonly fromAddressEntityLogo?: string; /** * @description The address that sent the NFT */ @@ -72,6 +96,14 @@ export class EvmNativeTransfer { * @description The label of the from address */ public readonly fromAddressLabel?: string; + /** + * @description The to address entity + */ + public readonly toAddressEntity?: string; + /** + * @description The logo of the to address entity + */ + public readonly toAddressEntityLogo?: string; /** * @description The address that received the NFT */ @@ -106,8 +138,12 @@ export class EvmNativeTransfer { public readonly tokenLogo: string; private constructor(input: EvmNativeTransferInput) { + this.fromAddressEntity = input.fromAddressEntity; + this.fromAddressEntityLogo = input.fromAddressEntityLogo; this.fromAddress = EvmAddress.create(input.fromAddress); this.fromAddressLabel = input.fromAddressLabel; + this.toAddressEntity = input.toAddressEntity; + this.toAddressEntityLogo = input.toAddressEntityLogo; this.toAddress = input.toAddress ? EvmAddress.create(input.toAddress) : undefined; this.toAddressLabel = input.toAddressLabel; this.value = input.value; @@ -120,8 +156,12 @@ export class EvmNativeTransfer { public toJSON(): EvmNativeTransferJSON { return { + from_address_entity: this.fromAddressEntity, + from_address_entity_logo: this.fromAddressEntityLogo, from_address: this.fromAddress.toJSON(), from_address_label: this.fromAddressLabel, + to_address_entity: this.toAddressEntity, + to_address_entity_logo: this.toAddressEntityLogo, to_address: this.toAddress ? this.toAddress.toJSON() : undefined, to_address_label: this.toAddressLabel, value: this.value, diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts index f2f41e8de9..4b5c177fde 100644 --- a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts +++ b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts @@ -9,8 +9,12 @@ import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; // - token_decimals ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/token_decimals) // - address ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/address) // - block_timestamp ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/block_timestamp) +// - to_address_entity ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/to_address_entity) +// - to_address_entity_logo ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/to_address_entity_logo) // - to_address ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/to_address) // - to_address_label ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/to_address_label) +// - from_address_entity ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/from_address_entity) +// - from_address_entity_logo ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/from_address_entity_logo) // - from_address ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/from_address) // - from_address_label ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/from_address_label) // - value ($ref: #/components/schemas/walletHistoryErc20Transfer/properties/value) @@ -26,8 +30,12 @@ export interface EvmWalletHistoryErc20TransferJSON { readonly token_decimals: string; readonly address: EvmAddressJSON; readonly block_timestamp?: string; + readonly to_address_entity?: string; + readonly to_address_entity_logo?: string; readonly to_address?: EvmAddressJSON; readonly to_address_label?: string; + readonly from_address_entity?: string; + readonly from_address_entity_logo?: string; readonly from_address: EvmAddressJSON; readonly from_address_label?: string; readonly value: string; @@ -44,8 +52,12 @@ export interface EvmWalletHistoryErc20TransferInput { readonly tokenDecimals: number; readonly address: EvmAddressInput | EvmAddress; readonly blockTimestamp?: string; + readonly toAddressEntity?: string; + readonly toAddressEntityLogo?: string; readonly toAddress?: EvmAddressInput | EvmAddress; readonly toAddressLabel?: string; + readonly fromAddressEntity?: string; + readonly fromAddressEntityLogo?: string; readonly fromAddress: EvmAddressInput | EvmAddress; readonly fromAddressLabel?: string; readonly value: string; @@ -71,8 +83,12 @@ export class EvmWalletHistoryErc20Transfer { tokenDecimals: Number(json.token_decimals), address: EvmAddress.fromJSON(json.address), blockTimestamp: json.block_timestamp, + toAddressEntity: json.to_address_entity, + toAddressEntityLogo: json.to_address_entity_logo, toAddress: json.to_address ? EvmAddress.fromJSON(json.to_address) : undefined, toAddressLabel: json.to_address_label, + fromAddressEntity: json.from_address_entity, + fromAddressEntityLogo: json.from_address_entity_logo, fromAddress: EvmAddress.fromJSON(json.from_address), fromAddressLabel: json.from_address_label, value: json.value, @@ -96,6 +112,14 @@ export class EvmWalletHistoryErc20Transfer { * @description The block timestamp */ public readonly blockTimestamp?: string; + /** + * @description The to address entity + */ + public readonly toAddressEntity?: string; + /** + * @description The logo of the to address entity + */ + public readonly toAddressEntityLogo?: string; /** * @description The recipient */ @@ -104,6 +128,14 @@ export class EvmWalletHistoryErc20Transfer { * @description The label of the to address */ public readonly toAddressLabel?: string; + /** + * @description The from address entity + */ + public readonly fromAddressEntity?: string; + /** + * @description The logo of the from address entity + */ + public readonly fromAddressEntityLogo?: string; /** * @description The sender */ @@ -140,8 +172,12 @@ export class EvmWalletHistoryErc20Transfer { this.tokenDecimals = input.tokenDecimals; this.address = EvmAddress.create(input.address); this.blockTimestamp = input.blockTimestamp; + this.toAddressEntity = input.toAddressEntity; + this.toAddressEntityLogo = input.toAddressEntityLogo; this.toAddress = input.toAddress ? EvmAddress.create(input.toAddress) : undefined; this.toAddressLabel = input.toAddressLabel; + this.fromAddressEntity = input.fromAddressEntity; + this.fromAddressEntityLogo = input.fromAddressEntityLogo; this.fromAddress = EvmAddress.create(input.fromAddress); this.fromAddressLabel = input.fromAddressLabel; this.value = input.value; @@ -159,8 +195,12 @@ export class EvmWalletHistoryErc20Transfer { token_decimals: String(this.tokenDecimals), address: this.address.toJSON(), block_timestamp: this.blockTimestamp, + to_address_entity: this.toAddressEntity, + to_address_entity_logo: this.toAddressEntityLogo, to_address: this.toAddress ? this.toAddress.toJSON() : undefined, to_address_label: this.toAddressLabel, + from_address_entity: this.fromAddressEntity, + from_address_entity_logo: this.fromAddressEntityLogo, from_address: this.fromAddress.toJSON(), from_address_label: this.fromAddressLabel, value: this.value, diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts index 740b2bc317..f9f47d58ac 100644 --- a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts +++ b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts @@ -6,8 +6,12 @@ import { EvmNormalizedMetadata, EvmNormalizedMetadataInput, EvmNormalizedMetadat // properties: // - token_address ($ref: #/components/schemas/walletHistoryNftTransfer/properties/token_address) // - token_id ($ref: #/components/schemas/walletHistoryNftTransfer/properties/token_id) +// - from_address_entity ($ref: #/components/schemas/walletHistoryNftTransfer/properties/from_address_entity) +// - from_address_entity_logo ($ref: #/components/schemas/walletHistoryNftTransfer/properties/from_address_entity_logo) // - from_address ($ref: #/components/schemas/walletHistoryNftTransfer/properties/from_address) // - from_address_label ($ref: #/components/schemas/walletHistoryNftTransfer/properties/from_address_label) +// - to_address_entity ($ref: #/components/schemas/walletHistoryNftTransfer/properties/to_address_entity) +// - to_address_entity_logo ($ref: #/components/schemas/walletHistoryNftTransfer/properties/to_address_entity_logo) // - to_address ($ref: #/components/schemas/walletHistoryNftTransfer/properties/to_address) // - to_address_label ($ref: #/components/schemas/walletHistoryNftTransfer/properties/to_address_label) // - value ($ref: #/components/schemas/walletHistoryNftTransfer/properties/value) @@ -26,8 +30,12 @@ import { EvmNormalizedMetadata, EvmNormalizedMetadataInput, EvmNormalizedMetadat export interface EvmWalletHistoryNftTransferJSON { readonly token_address: EvmAddressJSON; readonly token_id: string; + readonly from_address_entity?: string; + readonly from_address_entity_logo?: string; readonly from_address: EvmAddressJSON; readonly from_address_label?: string; + readonly to_address_entity?: string; + readonly to_address_entity_logo?: string; readonly to_address?: EvmAddressJSON; readonly to_address_label?: string; readonly value: string; @@ -47,8 +55,12 @@ export interface EvmWalletHistoryNftTransferJSON { export interface EvmWalletHistoryNftTransferInput { readonly tokenAddress: EvmAddressInput | EvmAddress; readonly tokenId: string; + readonly fromAddressEntity?: string; + readonly fromAddressEntityLogo?: string; readonly fromAddress: EvmAddressInput | EvmAddress; readonly fromAddressLabel?: string; + readonly toAddressEntity?: string; + readonly toAddressEntityLogo?: string; readonly toAddress?: EvmAddressInput | EvmAddress; readonly toAddressLabel?: string; readonly value: string; @@ -77,8 +89,12 @@ export class EvmWalletHistoryNftTransfer { const input: EvmWalletHistoryNftTransferInput = { tokenAddress: EvmAddress.fromJSON(json.token_address), tokenId: json.token_id, + fromAddressEntity: json.from_address_entity, + fromAddressEntityLogo: json.from_address_entity_logo, fromAddress: EvmAddress.fromJSON(json.from_address), fromAddressLabel: json.from_address_label, + toAddressEntity: json.to_address_entity, + toAddressEntityLogo: json.to_address_entity_logo, toAddress: json.to_address ? EvmAddress.fromJSON(json.to_address) : undefined, toAddressLabel: json.to_address_label, value: json.value, @@ -105,6 +121,14 @@ export class EvmWalletHistoryNftTransfer { * @description The token ID of the NFT */ public readonly tokenId: string; + /** + * @description The from address entity + */ + public readonly fromAddressEntity?: string; + /** + * @description The logo of the from address entity + */ + public readonly fromAddressEntityLogo?: string; /** * @description The address that sent the NFT */ @@ -113,6 +137,14 @@ export class EvmWalletHistoryNftTransfer { * @description The label of the from address */ public readonly fromAddressLabel?: string; + /** + * @description The to address entity + */ + public readonly toAddressEntity?: string; + /** + * @description The logo of the to address entity + */ + public readonly toAddressEntityLogo?: string; /** * @description The address that received the NFT */ @@ -173,8 +205,12 @@ export class EvmWalletHistoryNftTransfer { private constructor(input: EvmWalletHistoryNftTransferInput) { this.tokenAddress = EvmAddress.create(input.tokenAddress); this.tokenId = input.tokenId; + this.fromAddressEntity = input.fromAddressEntity; + this.fromAddressEntityLogo = input.fromAddressEntityLogo; this.fromAddress = EvmAddress.create(input.fromAddress); this.fromAddressLabel = input.fromAddressLabel; + this.toAddressEntity = input.toAddressEntity; + this.toAddressEntityLogo = input.toAddressEntityLogo; this.toAddress = input.toAddress ? EvmAddress.create(input.toAddress) : undefined; this.toAddressLabel = input.toAddressLabel; this.value = input.value; @@ -195,8 +231,12 @@ export class EvmWalletHistoryNftTransfer { return { token_address: this.tokenAddress.toJSON(), token_id: this.tokenId, + from_address_entity: this.fromAddressEntity, + from_address_entity_logo: this.fromAddressEntityLogo, from_address: this.fromAddress.toJSON(), from_address_label: this.fromAddressLabel, + to_address_entity: this.toAddressEntity, + to_address_entity_logo: this.toAddressEntityLogo, to_address: this.toAddress ? this.toAddress.toJSON() : undefined, to_address_label: this.toAddressLabel, value: this.value, diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts index 7868ca0d97..744dac7893 100644 --- a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts +++ b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts @@ -5,7 +5,7 @@ import { EvmResolveContractInteractionResponse, EvmResolveContractInteractionRes import { EvmWalletHistoryNftTransfer, EvmWalletHistoryNftTransferInput, EvmWalletHistoryNftTransferJSON } from '../types/EvmWalletHistoryNftTransfer'; import { EvmWalletHistoryErc20Transfer, EvmWalletHistoryErc20TransferInput, EvmWalletHistoryErc20TransferJSON } from '../types/EvmWalletHistoryErc20Transfer'; import { EvmNativeTransfer, EvmNativeTransferInput, EvmNativeTransferJSON } from '../types/EvmNativeTransfer'; -import { EvmLog, EvmLogInput, EvmLogJSON } from '../types/EvmLog'; +import { EvmLogVerbose, EvmLogVerboseInput, EvmLogVerboseJSON } from '../types/EvmLogVerbose'; // $ref: #/components/schemas/walletHistoryTransaction // type: walletHistoryTransaction @@ -13,8 +13,12 @@ import { EvmLog, EvmLogInput, EvmLogJSON } from '../types/EvmLog'; // - hash ($ref: #/components/schemas/walletHistoryTransaction/properties/hash) // - nonce ($ref: #/components/schemas/walletHistoryTransaction/properties/nonce) // - transaction_index ($ref: #/components/schemas/walletHistoryTransaction/properties/transaction_index) +// - from_address_entity ($ref: #/components/schemas/walletHistoryTransaction/properties/from_address_entity) +// - from_address_entity_logo ($ref: #/components/schemas/walletHistoryTransaction/properties/from_address_entity_logo) // - from_address ($ref: #/components/schemas/walletHistoryTransaction/properties/from_address) // - from_address_label ($ref: #/components/schemas/walletHistoryTransaction/properties/from_address_label) +// - to_address_entity ($ref: #/components/schemas/walletHistoryTransaction/properties/to_address_entity) +// - to_address_entity_logo ($ref: #/components/schemas/walletHistoryTransaction/properties/to_address_entity_logo) // - to_address ($ref: #/components/schemas/walletHistoryTransaction/properties/to_address) // - to_address_label ($ref: #/components/schemas/walletHistoryTransaction/properties/to_address_label) // - value ($ref: #/components/schemas/walletHistoryTransaction/properties/value) @@ -38,14 +42,18 @@ import { EvmLog, EvmLogInput, EvmLogJSON } from '../types/EvmLog'; // - nft_transfers ($ref: #/components/schemas/walletHistoryNftTransfer) // - erc20_transfers ($ref: #/components/schemas/walletHistoryErc20Transfer) // - native_transfers ($ref: #/components/schemas/native_transfer) -// - logs ($ref: #/components/schemas/log) +// - logs ($ref: #/components/schemas/logVerbose) export interface EvmWalletHistoryTransactionJSON { readonly hash: string; readonly nonce: string; readonly transaction_index: string; + readonly from_address_entity?: string; + readonly from_address_entity_logo?: string; readonly from_address: EvmAddressJSON; readonly from_address_label?: string; + readonly to_address_entity?: string; + readonly to_address_entity_logo?: string; readonly to_address?: EvmAddressJSON; readonly to_address_label?: string; readonly value: string; @@ -69,15 +77,19 @@ export interface EvmWalletHistoryTransactionJSON { readonly nft_transfers: EvmWalletHistoryNftTransferJSON[]; readonly erc20_transfers: EvmWalletHistoryErc20TransferJSON[]; readonly native_transfers: EvmNativeTransferJSON[]; - readonly logs?: EvmLogJSON[]; + readonly logs?: EvmLogVerboseJSON[]; } export interface EvmWalletHistoryTransactionInput { readonly hash: string; readonly nonce: string; readonly transactionIndex: number; + readonly fromAddressEntity?: string; + readonly fromAddressEntityLogo?: string; readonly fromAddress: EvmAddressInput | EvmAddress; readonly fromAddressLabel?: string; + readonly toAddressEntity?: string; + readonly toAddressEntityLogo?: string; readonly toAddress?: EvmAddressInput | EvmAddress; readonly toAddressLabel?: string; readonly value: string; @@ -101,7 +113,7 @@ export interface EvmWalletHistoryTransactionInput { readonly nftTransfers: EvmWalletHistoryNftTransferInput[] | EvmWalletHistoryNftTransfer[]; readonly erc20Transfers: EvmWalletHistoryErc20TransferInput[] | EvmWalletHistoryErc20Transfer[]; readonly nativeTransfers: EvmNativeTransferInput[] | EvmNativeTransfer[]; - readonly logs?: EvmLogInput[] | EvmLog[]; + readonly logs?: EvmLogVerboseInput[] | EvmLogVerbose[]; } export class EvmWalletHistoryTransaction { @@ -117,8 +129,12 @@ export class EvmWalletHistoryTransaction { hash: json.hash, nonce: json.nonce, transactionIndex: Number(json.transaction_index), + fromAddressEntity: json.from_address_entity, + fromAddressEntityLogo: json.from_address_entity_logo, fromAddress: EvmAddress.fromJSON(json.from_address), fromAddressLabel: json.from_address_label, + toAddressEntity: json.to_address_entity, + toAddressEntityLogo: json.to_address_entity_logo, toAddress: json.to_address ? EvmAddress.fromJSON(json.to_address) : undefined, toAddressLabel: json.to_address_label, value: json.value, @@ -142,7 +158,7 @@ export class EvmWalletHistoryTransaction { nftTransfers: json.nft_transfers.map((item) => EvmWalletHistoryNftTransfer.fromJSON(item)), erc20Transfers: json.erc20_transfers.map((item) => EvmWalletHistoryErc20Transfer.fromJSON(item)), nativeTransfers: json.native_transfers.map((item) => EvmNativeTransfer.fromJSON(item)), - logs: json.logs ? json.logs.map((item) => EvmLog.fromJSON(item)) : undefined, + logs: json.logs ? json.logs.map((item) => EvmLogVerbose.fromJSON(item)) : undefined, }; return EvmWalletHistoryTransaction.create(input); } @@ -156,6 +172,14 @@ export class EvmWalletHistoryTransaction { */ public readonly nonce: string; public readonly transactionIndex: number; + /** + * @description The from address entity + */ + public readonly fromAddressEntity?: string; + /** + * @description The logo of the from address entity + */ + public readonly fromAddressEntityLogo?: string; /** * @description The from address */ @@ -164,6 +188,14 @@ export class EvmWalletHistoryTransaction { * @description The label of the from address */ public readonly fromAddressLabel?: string; + /** + * @description The to address entity + */ + public readonly toAddressEntity?: string; + /** + * @description The logo of the to address entity + */ + public readonly toAddressEntityLogo?: string; /** * @description The to address */ @@ -223,14 +255,18 @@ export class EvmWalletHistoryTransaction { public readonly nftTransfers: EvmWalletHistoryNftTransfer[]; public readonly erc20Transfers: EvmWalletHistoryErc20Transfer[]; public readonly nativeTransfers: EvmNativeTransfer[]; - public readonly logs?: EvmLog[]; + public readonly logs?: EvmLogVerbose[]; private constructor(input: EvmWalletHistoryTransactionInput) { this.hash = input.hash; this.nonce = input.nonce; this.transactionIndex = input.transactionIndex; + this.fromAddressEntity = input.fromAddressEntity; + this.fromAddressEntityLogo = input.fromAddressEntityLogo; this.fromAddress = EvmAddress.create(input.fromAddress); this.fromAddressLabel = input.fromAddressLabel; + this.toAddressEntity = input.toAddressEntity; + this.toAddressEntityLogo = input.toAddressEntityLogo; this.toAddress = input.toAddress ? EvmAddress.create(input.toAddress) : undefined; this.toAddressLabel = input.toAddressLabel; this.value = input.value; @@ -254,7 +290,7 @@ export class EvmWalletHistoryTransaction { this.nftTransfers = input.nftTransfers.map((item) => EvmWalletHistoryNftTransfer.create(item)); this.erc20Transfers = input.erc20Transfers.map((item) => EvmWalletHistoryErc20Transfer.create(item)); this.nativeTransfers = input.nativeTransfers.map((item) => EvmNativeTransfer.create(item)); - this.logs = input.logs ? input.logs.map((item) => EvmLog.create(item)) : undefined; + this.logs = input.logs ? input.logs.map((item) => EvmLogVerbose.create(item)) : undefined; } public toJSON(): EvmWalletHistoryTransactionJSON { @@ -262,8 +298,12 @@ export class EvmWalletHistoryTransaction { hash: this.hash, nonce: this.nonce, transaction_index: String(this.transactionIndex), + from_address_entity: this.fromAddressEntity, + from_address_entity_logo: this.fromAddressEntityLogo, from_address: this.fromAddress.toJSON(), from_address_label: this.fromAddressLabel, + to_address_entity: this.toAddressEntity, + to_address_entity_logo: this.toAddressEntityLogo, to_address: this.toAddress ? this.toAddress.toJSON() : undefined, to_address_label: this.toAddressLabel, value: this.value, diff --git a/packages/common/evmUtils/src/generated/types/index.ts b/packages/common/evmUtils/src/generated/types/index.ts index 7077c64921..8154779c5a 100644 --- a/packages/common/evmUtils/src/generated/types/index.ts +++ b/packages/common/evmUtils/src/generated/types/index.ts @@ -79,12 +79,14 @@ export * from './EvmResolveContractInteractionResponse'; export * from './EvmWalletHistoryNftTransfer'; export * from './EvmWalletHistoryErc20Transfer'; export * from './EvmNativeTransfer'; -export * from './EvmLog'; +export * from './EvmLogVerbose'; export * from './EvmDefiTokenBalance'; export * from './EvmDefiPositionDetails'; export * from './EvmTransactionTimestamp'; export * from './EvmCommonContractData'; export * from './EvmNormalizedMetadata'; +export * from './EvmDecodedEvent'; export * from './EvmContractTokenDetails'; export * from './EvmContractSpenderDetails'; export * from './EvmNormalizedMetadataAttribute'; +export * from './EvmDecodedEventParamsItem';