diff --git a/.changeset/fuzzy-moose-yawn.md b/.changeset/fuzzy-moose-yawn.md new file mode 100644 index 0000000000..a3f2a8e5af --- /dev/null +++ b/.changeset/fuzzy-moose-yawn.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Update the return types of the `getWalletHistory` method. diff --git a/packages/common/evmUtils/src/generated/types/EvmCommonContractData.ts b/packages/common/evmUtils/src/generated/types/EvmCommonContractData.ts new file mode 100644 index 0000000000..55fe0d4297 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmCommonContractData.ts @@ -0,0 +1,64 @@ +import { EvmContractTokenDetails, EvmContractTokenDetailsInput, EvmContractTokenDetailsJSON } from '../types/EvmContractTokenDetails'; +import { EvmContractSpenderDetails, EvmContractSpenderDetailsInput, EvmContractSpenderDetailsJSON } from '../types/EvmContractSpenderDetails'; + +// $ref: #/components/schemas/CommonContractData +// type: CommonContractData +// properties: +// - value ($ref: #/components/schemas/CommonContractData/properties/value) +// - value_formatted ($ref: #/components/schemas/CommonContractData/properties/value_formatted) +// - token ($ref: #/components/schemas/ContractTokenDetails) +// - spender ($ref: #/components/schemas/ContractSpenderDetails) + +export interface EvmCommonContractDataJSON { + readonly value: string; + readonly value_formatted?: string; + readonly token: EvmContractTokenDetailsJSON; + readonly spender: EvmContractSpenderDetailsJSON; +} + +export interface EvmCommonContractDataInput { + readonly value: string; + readonly valueFormatted?: string; + readonly token: EvmContractTokenDetailsInput | EvmContractTokenDetails; + readonly spender: EvmContractSpenderDetailsInput | EvmContractSpenderDetails; +} + +export class EvmCommonContractData { + public static create(input: EvmCommonContractDataInput | EvmCommonContractData): EvmCommonContractData { + if (input instanceof EvmCommonContractData) { + return input; + } + return new EvmCommonContractData(input); + } + + public static fromJSON(json: EvmCommonContractDataJSON): EvmCommonContractData { + const input: EvmCommonContractDataInput = { + value: json.value, + valueFormatted: json.value_formatted, + token: EvmContractTokenDetails.fromJSON(json.token), + spender: EvmContractSpenderDetails.fromJSON(json.spender), + }; + return EvmCommonContractData.create(input); + } + + public readonly value: string; + public readonly valueFormatted?: string; + public readonly token: EvmContractTokenDetails; + public readonly spender: EvmContractSpenderDetails; + + private constructor(input: EvmCommonContractDataInput) { + this.value = input.value; + this.valueFormatted = input.valueFormatted; + this.token = EvmContractTokenDetails.create(input.token); + this.spender = EvmContractSpenderDetails.create(input.spender); + } + + public toJSON(): EvmCommonContractDataJSON { + return { + value: this.value, + value_formatted: this.valueFormatted, + token: this.token.toJSON(), + spender: this.spender.toJSON(), + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmContractSpenderDetails.ts b/packages/common/evmUtils/src/generated/types/EvmContractSpenderDetails.ts new file mode 100644 index 0000000000..fccf4bf91b --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmContractSpenderDetails.ts @@ -0,0 +1,70 @@ +import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; + +// $ref: #/components/schemas/ContractSpenderDetails +// type: ContractSpenderDetails +// properties: +// - address ($ref: #/components/schemas/ContractSpenderDetails/properties/address) +// - address_label ($ref: #/components/schemas/ContractSpenderDetails/properties/address_label) +// - name ($ref: #/components/schemas/ContractSpenderDetails/properties/name) +// - symbol ($ref: #/components/schemas/ContractSpenderDetails/properties/symbol) +// - logo ($ref: #/components/schemas/ContractSpenderDetails/properties/logo) + +export interface EvmContractSpenderDetailsJSON { + readonly address: EvmAddressJSON; + readonly address_label?: string; + readonly name?: string; + readonly symbol?: string; + readonly logo?: string; +} + +export interface EvmContractSpenderDetailsInput { + readonly address: EvmAddressInput | EvmAddress; + readonly addressLabel?: string; + readonly name?: string; + readonly symbol?: string; + readonly logo?: string; +} + +export class EvmContractSpenderDetails { + public static create(input: EvmContractSpenderDetailsInput | EvmContractSpenderDetails): EvmContractSpenderDetails { + if (input instanceof EvmContractSpenderDetails) { + return input; + } + return new EvmContractSpenderDetails(input); + } + + public static fromJSON(json: EvmContractSpenderDetailsJSON): EvmContractSpenderDetails { + const input: EvmContractSpenderDetailsInput = { + address: EvmAddress.fromJSON(json.address), + addressLabel: json.address_label, + name: json.name, + symbol: json.symbol, + logo: json.logo, + }; + return EvmContractSpenderDetails.create(input); + } + + public readonly address: EvmAddress; + public readonly addressLabel?: string; + public readonly name?: string; + public readonly symbol?: string; + public readonly logo?: string; + + private constructor(input: EvmContractSpenderDetailsInput) { + this.address = EvmAddress.create(input.address); + this.addressLabel = input.addressLabel; + this.name = input.name; + this.symbol = input.symbol; + this.logo = input.logo; + } + + public toJSON(): EvmContractSpenderDetailsJSON { + return { + address: this.address.toJSON(), + address_label: this.addressLabel, + name: this.name, + symbol: this.symbol, + logo: this.logo, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmContractTokenDetails.ts b/packages/common/evmUtils/src/generated/types/EvmContractTokenDetails.ts new file mode 100644 index 0000000000..d3be438e53 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmContractTokenDetails.ts @@ -0,0 +1,70 @@ +import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; + +// $ref: #/components/schemas/ContractTokenDetails +// type: ContractTokenDetails +// properties: +// - address ($ref: #/components/schemas/ContractTokenDetails/properties/address) +// - address_label ($ref: #/components/schemas/ContractTokenDetails/properties/address_label) +// - token_name ($ref: #/components/schemas/ContractTokenDetails/properties/token_name) +// - token_logo ($ref: #/components/schemas/ContractTokenDetails/properties/token_logo) +// - token_symbol ($ref: #/components/schemas/ContractTokenDetails/properties/token_symbol) + +export interface EvmContractTokenDetailsJSON { + readonly address: EvmAddressJSON; + readonly address_label?: string; + readonly token_name: string; + readonly token_logo: string; + readonly token_symbol: string; +} + +export interface EvmContractTokenDetailsInput { + readonly address: EvmAddressInput | EvmAddress; + readonly addressLabel?: string; + readonly tokenName: string; + readonly tokenLogo: string; + readonly tokenSymbol: string; +} + +export class EvmContractTokenDetails { + public static create(input: EvmContractTokenDetailsInput | EvmContractTokenDetails): EvmContractTokenDetails { + if (input instanceof EvmContractTokenDetails) { + return input; + } + return new EvmContractTokenDetails(input); + } + + public static fromJSON(json: EvmContractTokenDetailsJSON): EvmContractTokenDetails { + const input: EvmContractTokenDetailsInput = { + address: EvmAddress.fromJSON(json.address), + addressLabel: json.address_label, + tokenName: json.token_name, + tokenLogo: json.token_logo, + tokenSymbol: json.token_symbol, + }; + return EvmContractTokenDetails.create(input); + } + + public readonly address: EvmAddress; + public readonly addressLabel?: string; + public readonly tokenName: string; + public readonly tokenLogo: string; + public readonly tokenSymbol: string; + + private constructor(input: EvmContractTokenDetailsInput) { + this.address = EvmAddress.create(input.address); + this.addressLabel = input.addressLabel; + this.tokenName = input.tokenName; + this.tokenLogo = input.tokenLogo; + this.tokenSymbol = input.tokenSymbol; + } + + public toJSON(): EvmContractTokenDetailsJSON { + return { + address: this.address.toJSON(), + address_label: this.addressLabel, + token_name: this.tokenName, + token_logo: this.tokenLogo, + token_symbol: this.tokenSymbol, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts b/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts index f608b230fc..2601a44270 100644 --- a/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts +++ b/packages/common/evmUtils/src/generated/types/EvmDefiPositionDetails.ts @@ -27,6 +27,9 @@ import { EvmDefiPositionDetailsNftMetadata, EvmDefiPositionDetailsNftMetadataVal // - factory ($ref: #/components/schemas/defiPositionDetails/properties/factory) // - pair ($ref: #/components/schemas/defiPositionDetails/properties/pair) // - share_of_pool ($ref: #/components/schemas/defiPositionDetails/properties/share_of_pool) +// - 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) export interface EvmDefiPositionDetailsJSON { readonly fee_tier?: number; @@ -53,6 +56,9 @@ export interface EvmDefiPositionDetailsJSON { readonly factory?: string; readonly pair?: string; readonly share_of_pool?: number; + readonly no_price_available?: boolean; + readonly shares_in_strategy?: string; + readonly strategy_address?: string; } export interface EvmDefiPositionDetailsInput { @@ -80,6 +86,9 @@ export interface EvmDefiPositionDetailsInput { readonly factory?: string; readonly pair?: string; readonly shareOfPool?: number; + readonly noPriceAvailable?: boolean; + readonly sharesInStrategy?: string; + readonly strategyAddress?: string; } export class EvmDefiPositionDetails { @@ -116,6 +125,9 @@ export class EvmDefiPositionDetails { factory: json.factory, pair: json.pair, shareOfPool: json.share_of_pool, + noPriceAvailable: json.no_price_available, + sharesInStrategy: json.shares_in_strategy, + strategyAddress: json.strategy_address, }; return EvmDefiPositionDetails.create(input); } @@ -216,6 +228,18 @@ export class EvmDefiPositionDetails { * @description The share of the pool */ public readonly shareOfPool?: number; + /** + * @description Whether the price is available + */ + public readonly noPriceAvailable?: boolean; + /** + * @description The shares in the strategy + */ + public readonly sharesInStrategy?: string; + /** + * @description The address of the strategy + */ + public readonly strategyAddress?: string; private constructor(input: EvmDefiPositionDetailsInput) { this.feeTier = input.feeTier; @@ -242,6 +266,9 @@ export class EvmDefiPositionDetails { this.factory = input.factory; this.pair = input.pair; this.shareOfPool = input.shareOfPool; + this.noPriceAvailable = input.noPriceAvailable; + this.sharesInStrategy = input.sharesInStrategy; + this.strategyAddress = input.strategyAddress; } public toJSON(): EvmDefiPositionDetailsJSON { @@ -270,6 +297,9 @@ export class EvmDefiPositionDetails { factory: this.factory, pair: this.pair, share_of_pool: this.shareOfPool, + no_price_available: this.noPriceAvailable, + shares_in_strategy: this.sharesInStrategy, + strategy_address: this.strategyAddress, } } } diff --git a/packages/common/evmUtils/src/generated/types/EvmResolveContractInteractionResponse.ts b/packages/common/evmUtils/src/generated/types/EvmResolveContractInteractionResponse.ts new file mode 100644 index 0000000000..29d73300c1 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmResolveContractInteractionResponse.ts @@ -0,0 +1,63 @@ +import { EvmCommonContractData, EvmCommonContractDataInput, EvmCommonContractDataJSON } from '../types/EvmCommonContractData'; + +// $ref: #/components/schemas/ResolveContractInteractionResponse +// type: ResolveContractInteractionResponse +// properties: +// - approvals ($ref: #/components/schemas/CommonContractData) +// - revokes ($ref: #/components/schemas/CommonContractData) +// - approvalsAll ($ref: #/components/schemas/CommonContractData) +// - revokesAll ($ref: #/components/schemas/CommonContractData) + +export interface EvmResolveContractInteractionResponseJSON { + readonly approvals?: EvmCommonContractDataJSON[]; + readonly revokes?: EvmCommonContractDataJSON[]; + readonly approvalsAll?: EvmCommonContractDataJSON[]; + readonly revokesAll?: EvmCommonContractDataJSON[]; +} + +export interface EvmResolveContractInteractionResponseInput { + readonly approvals?: EvmCommonContractDataInput[] | EvmCommonContractData[]; + readonly revokes?: EvmCommonContractDataInput[] | EvmCommonContractData[]; + readonly approvalsAll?: EvmCommonContractDataInput[] | EvmCommonContractData[]; + readonly revokesAll?: EvmCommonContractDataInput[] | EvmCommonContractData[]; +} + +export class EvmResolveContractInteractionResponse { + public static create(input: EvmResolveContractInteractionResponseInput | EvmResolveContractInteractionResponse): EvmResolveContractInteractionResponse { + if (input instanceof EvmResolveContractInteractionResponse) { + return input; + } + return new EvmResolveContractInteractionResponse(input); + } + + public static fromJSON(json: EvmResolveContractInteractionResponseJSON): EvmResolveContractInteractionResponse { + const input: EvmResolveContractInteractionResponseInput = { + approvals: json.approvals ? json.approvals.map((item) => EvmCommonContractData.fromJSON(item)) : undefined, + revokes: json.revokes ? json.revokes.map((item) => EvmCommonContractData.fromJSON(item)) : undefined, + approvalsAll: json.approvalsAll ? json.approvalsAll.map((item) => EvmCommonContractData.fromJSON(item)) : undefined, + revokesAll: json.revokesAll ? json.revokesAll.map((item) => EvmCommonContractData.fromJSON(item)) : undefined, + }; + return EvmResolveContractInteractionResponse.create(input); + } + + public readonly approvals?: EvmCommonContractData[]; + public readonly revokes?: EvmCommonContractData[]; + public readonly approvalsAll?: EvmCommonContractData[]; + public readonly revokesAll?: EvmCommonContractData[]; + + private constructor(input: EvmResolveContractInteractionResponseInput) { + this.approvals = input.approvals ? input.approvals.map((item) => EvmCommonContractData.create(item)) : undefined; + this.revokes = input.revokes ? input.revokes.map((item) => EvmCommonContractData.create(item)) : undefined; + this.approvalsAll = input.approvalsAll ? input.approvalsAll.map((item) => EvmCommonContractData.create(item)) : undefined; + this.revokesAll = input.revokesAll ? input.revokesAll.map((item) => EvmCommonContractData.create(item)) : undefined; + } + + public toJSON(): EvmResolveContractInteractionResponseJSON { + return { + approvals: this.approvals ? this.approvals.map((item) => item.toJSON()) : undefined, + revokes: this.revokes ? this.revokes.map((item) => item.toJSON()) : undefined, + approvalsAll: this.approvalsAll ? this.approvalsAll.map((item) => item.toJSON()) : undefined, + revokesAll: this.revokesAll ? this.revokesAll.map((item) => item.toJSON()) : undefined, + } + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmTopProfitableWalletPerTokenResponse.ts b/packages/common/evmUtils/src/generated/types/EvmTopProfitableWalletPerTokenResponse.ts index d4322d5bf5..3a0c8423c1 100644 --- a/packages/common/evmUtils/src/generated/types/EvmTopProfitableWalletPerTokenResponse.ts +++ b/packages/common/evmUtils/src/generated/types/EvmTopProfitableWalletPerTokenResponse.ts @@ -9,7 +9,6 @@ import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; // - 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) @@ -23,7 +22,6 @@ export interface EvmTopProfitableWalletPerTokenResponseJSON { 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; @@ -38,7 +36,6 @@ export interface EvmTopProfitableWalletPerTokenResponseInput { readonly countOfTrades: number; readonly realizedProfitPercentage: number; readonly realizedProfitUsd: string; - readonly totalProfitUsd?: string; readonly totalSoldUsd: string; readonly totalTokensBought: string; readonly totalTokensSold: string; @@ -62,7 +59,6 @@ export class EvmTopProfitableWalletPerTokenResponse { 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, @@ -96,10 +92,6 @@ export class EvmTopProfitableWalletPerTokenResponse { * @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. */ @@ -128,7 +120,6 @@ export class EvmTopProfitableWalletPerTokenResponse { 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; @@ -144,7 +135,6 @@ export class EvmTopProfitableWalletPerTokenResponse { 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, diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts index 4791b12a0f..7868ca0d97 100644 --- a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts +++ b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts @@ -1,6 +1,7 @@ import { EvmAddress, EvmAddressInput, EvmAddressJSON, EvmInternalTransaction, EvmInternalTransactionInput, EvmInternalTransactionJSON } from '../../dataTypes'; import { BigNumber, BigNumberInput, BigNumberJSON } from '@moralisweb3/common-core'; import { EvmETransactionCategory, EvmETransactionCategoryValue, EvmETransactionCategoryInput, EvmETransactionCategoryJSON } from '../types/EvmETransactionCategory'; +import { EvmResolveContractInteractionResponse, EvmResolveContractInteractionResponseInput, EvmResolveContractInteractionResponseJSON } from '../types/EvmResolveContractInteractionResponse'; import { EvmWalletHistoryNftTransfer, EvmWalletHistoryNftTransferInput, EvmWalletHistoryNftTransferJSON } from '../types/EvmWalletHistoryNftTransfer'; import { EvmWalletHistoryErc20Transfer, EvmWalletHistoryErc20TransferInput, EvmWalletHistoryErc20TransferJSON } from '../types/EvmWalletHistoryErc20Transfer'; import { EvmNativeTransfer, EvmNativeTransferInput, EvmNativeTransferJSON } from '../types/EvmNativeTransfer'; @@ -22,6 +23,7 @@ import { EvmLog, EvmLogInput, EvmLogJSON } from '../types/EvmLog'; // - input ($ref: #/components/schemas/walletHistoryTransaction/properties/input) // - receipt_cumulative_gas_used ($ref: #/components/schemas/walletHistoryTransaction/properties/receipt_cumulative_gas_used) // - receipt_gas_used ($ref: #/components/schemas/walletHistoryTransaction/properties/receipt_gas_used) +// - receipt_contract_address ($ref: #/components/schemas/walletHistoryTransaction/properties/receipt_contract_address) // - receipt_status ($ref: #/components/schemas/walletHistoryTransaction/properties/receipt_status) // - transaction_fee ($ref: #/components/schemas/walletHistoryTransaction/properties/transaction_fee) // - block_timestamp ($ref: #/components/schemas/walletHistoryTransaction/properties/block_timestamp) @@ -29,6 +31,7 @@ import { EvmLog, EvmLogInput, EvmLogJSON } from '../types/EvmLog'; // - block_hash ($ref: #/components/schemas/walletHistoryTransaction/properties/block_hash) // - internal_transactions ($ref: #/components/schemas/internalTransaction) // - category ($ref: #/components/schemas/ETransactionCategory) +// - contract_interactions ($ref: #/components/schemas/ResolveContractInteractionResponse) // - possible_spam ($ref: #/components/schemas/walletHistoryTransaction/properties/possible_spam) // - method_label ($ref: #/components/schemas/walletHistoryTransaction/properties/method_label) // - summary ($ref: #/components/schemas/walletHistoryTransaction/properties/summary) @@ -51,6 +54,7 @@ export interface EvmWalletHistoryTransactionJSON { readonly input?: string; readonly receipt_cumulative_gas_used: string; readonly receipt_gas_used: string; + readonly receipt_contract_address?: string; readonly receipt_status: string; readonly transaction_fee?: string; readonly block_timestamp: string; @@ -58,6 +62,7 @@ export interface EvmWalletHistoryTransactionJSON { readonly block_hash: string; readonly internal_transactions?: EvmInternalTransactionJSON[]; readonly category: EvmETransactionCategoryJSON; + readonly contract_interactions?: EvmResolveContractInteractionResponseJSON; readonly possible_spam?: boolean; readonly method_label?: string; readonly summary: string; @@ -81,6 +86,7 @@ export interface EvmWalletHistoryTransactionInput { readonly input?: string; readonly receiptCumulativeGasUsed: string; readonly receiptGasUsed: string; + readonly receiptContractAddress?: string; readonly receiptStatus: string; readonly transactionFee?: string; readonly blockTimestamp: string; @@ -88,6 +94,7 @@ export interface EvmWalletHistoryTransactionInput { readonly blockHash: string; readonly internalTransactions?: EvmInternalTransactionInput[] | EvmInternalTransaction[]; readonly category: EvmETransactionCategoryInput | EvmETransactionCategoryValue; + readonly contractInteractions?: EvmResolveContractInteractionResponseInput | EvmResolveContractInteractionResponse; readonly possibleSpam?: boolean; readonly methodLabel?: string; readonly summary: string; @@ -120,6 +127,7 @@ export class EvmWalletHistoryTransaction { input: json.input, receiptCumulativeGasUsed: json.receipt_cumulative_gas_used, receiptGasUsed: json.receipt_gas_used, + receiptContractAddress: json.receipt_contract_address, receiptStatus: json.receipt_status, transactionFee: json.transaction_fee, blockTimestamp: json.block_timestamp, @@ -127,6 +135,7 @@ export class EvmWalletHistoryTransaction { blockHash: json.block_hash, internalTransactions: json.internal_transactions ? json.internal_transactions.map((item) => EvmInternalTransaction.fromJSON(item)) : undefined, category: EvmETransactionCategory.fromJSON(json.category), + contractInteractions: json.contract_interactions ? EvmResolveContractInteractionResponse.fromJSON(json.contract_interactions) : undefined, possibleSpam: json.possible_spam, methodLabel: json.method_label, summary: json.summary, @@ -175,6 +184,7 @@ export class EvmWalletHistoryTransaction { public readonly input?: string; public readonly receiptCumulativeGasUsed: string; public readonly receiptGasUsed: string; + public readonly receiptContractAddress?: string; public readonly receiptStatus: string; public readonly transactionFee?: string; /** @@ -194,6 +204,10 @@ export class EvmWalletHistoryTransaction { */ public readonly internalTransactions?: EvmInternalTransaction[]; public readonly category: EvmETransactionCategoryValue; + /** + * @description The contract interactions that happend in the transaction + */ + public readonly contractInteractions?: EvmResolveContractInteractionResponse; /** * @description Is transaction possible spam */ @@ -225,6 +239,7 @@ export class EvmWalletHistoryTransaction { this.input = input.input; this.receiptCumulativeGasUsed = input.receiptCumulativeGasUsed; this.receiptGasUsed = input.receiptGasUsed; + this.receiptContractAddress = input.receiptContractAddress; this.receiptStatus = input.receiptStatus; this.transactionFee = input.transactionFee; this.blockTimestamp = input.blockTimestamp; @@ -232,6 +247,7 @@ export class EvmWalletHistoryTransaction { this.blockHash = input.blockHash; this.internalTransactions = input.internalTransactions ? input.internalTransactions.map((item) => EvmInternalTransaction.create(item)) : undefined; this.category = EvmETransactionCategory.create(input.category); + this.contractInteractions = input.contractInteractions ? EvmResolveContractInteractionResponse.create(input.contractInteractions) : undefined; this.possibleSpam = input.possibleSpam; this.methodLabel = input.methodLabel; this.summary = input.summary; @@ -256,6 +272,7 @@ export class EvmWalletHistoryTransaction { input: this.input, receipt_cumulative_gas_used: this.receiptCumulativeGasUsed, receipt_gas_used: this.receiptGasUsed, + receipt_contract_address: this.receiptContractAddress, receipt_status: this.receiptStatus, transaction_fee: this.transactionFee, block_timestamp: this.blockTimestamp, @@ -263,6 +280,7 @@ export class EvmWalletHistoryTransaction { block_hash: this.blockHash, internal_transactions: this.internalTransactions ? this.internalTransactions.map((item) => item.toJSON()) : undefined, category: this.category, + contract_interactions: this.contractInteractions ? this.contractInteractions.toJSON() : undefined, possible_spam: this.possibleSpam, method_label: this.methodLabel, summary: this.summary, diff --git a/packages/common/evmUtils/src/generated/types/index.ts b/packages/common/evmUtils/src/generated/types/index.ts index 6361ed4be9..dd7aed869a 100644 --- a/packages/common/evmUtils/src/generated/types/index.ts +++ b/packages/common/evmUtils/src/generated/types/index.ts @@ -74,6 +74,7 @@ export * from './EvmTopProfitableWalletPerTokenResponse'; export * from './EvmSoldPriceLastSalePaymentToken'; export * from './EvmSoldPriceLowestSalePaymentToken'; export * from './EvmSoldPriceHighestSalePaymentToken'; +export * from './EvmResolveContractInteractionResponse'; export * from './EvmWalletHistoryNftTransfer'; export * from './EvmWalletHistoryErc20Transfer'; export * from './EvmNativeTransfer'; @@ -81,5 +82,8 @@ export * from './EvmLog'; export * from './EvmDefiTokenBalance'; export * from './EvmDefiPositionDetails'; export * from './EvmTransactionTimestamp'; +export * from './EvmCommonContractData'; export * from './EvmNormalizedMetadata'; +export * from './EvmContractTokenDetails'; +export * from './EvmContractSpenderDetails'; export * from './EvmNormalizedMetadataAttribute';