From de53fb5052446a2c33cb3575cfefa9de556bf9f9 Mon Sep 17 00:00:00 2001 From: b4rtaz Date: Fri, 17 May 2024 14:22:15 +0200 Subject: [PATCH] feat: update swagger. --- .changeset/three-meals-drum.md | 7 +++ .../operations/GetNFTTradesOperation.ts | 2 +- .../src/generated/types/EvmChainList.ts | 6 +-- .../src/generated/types/EvmErc20Metadata.ts | 51 +++++++++++++++++++ .../generated/types/EvmErc20MetadataLinks.ts | 16 ++++++ .../src/generated/types/EvmErc20Price.ts | 16 ++++-- .../generated/types/EvmNftTradesChainList.ts | 16 ++++++ .../types/EvmWalletHistoryErc20Transfer.ts | 12 ++--- .../types/EvmWalletHistoryNftTransfer.ts | 12 ++--- .../types/EvmWalletHistoryTransaction.ts | 19 ++++--- .../evmUtils/src/generated/types/index.ts | 4 +- 11 files changed, 135 insertions(+), 26 deletions(-) create mode 100644 .changeset/three-meals-drum.md create mode 100644 packages/common/evmUtils/src/generated/types/EvmErc20MetadataLinks.ts create mode 100644 packages/common/evmUtils/src/generated/types/EvmNftTradesChainList.ts diff --git a/.changeset/three-meals-drum.md b/.changeset/three-meals-drum.md new file mode 100644 index 0000000000..1277061fe1 --- /dev/null +++ b/.changeset/three-meals-drum.md @@ -0,0 +1,7 @@ +--- +'@moralisweb3/common-evm-utils': patch +'@moralisweb3/evm-api': patch +'moralis': patch +--- + +Updated the types to reflect the changes in the swagger file. diff --git a/packages/common/evmUtils/src/generated/operations/GetNFTTradesOperation.ts b/packages/common/evmUtils/src/generated/operations/GetNFTTradesOperation.ts index b3c1ebecc5..0db83637c4 100644 --- a/packages/common/evmUtils/src/generated/operations/GetNFTTradesOperation.ts +++ b/packages/common/evmUtils/src/generated/operations/GetNFTTradesOperation.ts @@ -3,7 +3,7 @@ import { EvmGetNFTTradesMarketplaceEnum, EvmGetNFTTradesMarketplaceEnumValue, Ev import { EvmTradeCollection, EvmTradeCollectionJSON } from '../types/EvmTradeCollection'; // request parameters: -// - chain ($ref: #/components/schemas/chainList) +// - chain ($ref: #/components/schemas/nftTradesChainList) // - from_block ($ref: #/paths/~1nft~1{address}~1trades/get/parameters/1/schema) // - to_block ($ref: #/paths/~1nft~1{address}~1trades/get/parameters/2/schema) // - from_date ($ref: #/paths/~1nft~1{address}~1trades/get/parameters/3/schema) diff --git a/packages/common/evmUtils/src/generated/types/EvmChainList.ts b/packages/common/evmUtils/src/generated/types/EvmChainList.ts index e9868ef373..152ea44605 100644 --- a/packages/common/evmUtils/src/generated/types/EvmChainList.ts +++ b/packages/common/evmUtils/src/generated/types/EvmChainList.ts @@ -1,9 +1,9 @@ // $ref: #/components/schemas/chainList // typeName: chainList -export type EvmChainListJSON = "eth" | "0x1" | "goerli" | "0x5" | "sepolia" | "0xaa36a7" | "polygon" | "0x89" | "mumbai" | "0x13881" | "bsc" | "0x38" | "bsc testnet" | "0x61" | "avalanche" | "0xa86a" | "fantom" | "0xfa" | "palm" | "0x2a15c308d" | "cronos" | "0x19" | "arbitrum" | "0xa4b1" | "chiliz" | "0x15b38" | "chiliz testnet" | "0x15b32" | "gnosis" | "0x64" | "gnosis testnet" | "0x27d8" | "base" | "0x2105" | "base testnet" | "0x14a33" | "base sepolia" | "0x14a34" | "optimism" | "0xa" | "holesky" | "0x4268" | "polygon amoy" | "0x13882" | "linea" | "0xe708"; -export type EvmChainListInput = "eth" | "0x1" | "goerli" | "0x5" | "sepolia" | "0xaa36a7" | "polygon" | "0x89" | "mumbai" | "0x13881" | "bsc" | "0x38" | "bsc testnet" | "0x61" | "avalanche" | "0xa86a" | "fantom" | "0xfa" | "palm" | "0x2a15c308d" | "cronos" | "0x19" | "arbitrum" | "0xa4b1" | "chiliz" | "0x15b38" | "chiliz testnet" | "0x15b32" | "gnosis" | "0x64" | "gnosis testnet" | "0x27d8" | "base" | "0x2105" | "base testnet" | "0x14a33" | "base sepolia" | "0x14a34" | "optimism" | "0xa" | "holesky" | "0x4268" | "polygon amoy" | "0x13882" | "linea" | "0xe708"; -export type EvmChainListValue = "eth" | "0x1" | "goerli" | "0x5" | "sepolia" | "0xaa36a7" | "polygon" | "0x89" | "mumbai" | "0x13881" | "bsc" | "0x38" | "bsc testnet" | "0x61" | "avalanche" | "0xa86a" | "fantom" | "0xfa" | "palm" | "0x2a15c308d" | "cronos" | "0x19" | "arbitrum" | "0xa4b1" | "chiliz" | "0x15b38" | "chiliz testnet" | "0x15b32" | "gnosis" | "0x64" | "gnosis testnet" | "0x27d8" | "base" | "0x2105" | "base testnet" | "0x14a33" | "base sepolia" | "0x14a34" | "optimism" | "0xa" | "holesky" | "0x4268" | "polygon amoy" | "0x13882" | "linea" | "0xe708"; +export type EvmChainListJSON = "eth" | "0x1" | "sepolia" | "0xaa36a7" | "polygon" | "0x89" | "bsc" | "0x38" | "bsc testnet" | "0x61" | "avalanche" | "0xa86a" | "fantom" | "0xfa" | "palm" | "0x2a15c308d" | "cronos" | "0x19" | "arbitrum" | "0xa4b1" | "chiliz" | "0x15b38" | "chiliz testnet" | "0x15b32" | "gnosis" | "0x64" | "gnosis testnet" | "0x27d8" | "base" | "0x2105" | "base sepolia" | "0x14a34" | "optimism" | "0xa" | "holesky" | "0x4268" | "polygon amoy" | "0x13882" | "linea" | "0xe708" | "moonbeam" | "0x504" | "moonriver" | "0x505" | "moonbase" | "0x507" | "linea sepolia" | "0xe705"; +export type EvmChainListInput = "eth" | "0x1" | "sepolia" | "0xaa36a7" | "polygon" | "0x89" | "bsc" | "0x38" | "bsc testnet" | "0x61" | "avalanche" | "0xa86a" | "fantom" | "0xfa" | "palm" | "0x2a15c308d" | "cronos" | "0x19" | "arbitrum" | "0xa4b1" | "chiliz" | "0x15b38" | "chiliz testnet" | "0x15b32" | "gnosis" | "0x64" | "gnosis testnet" | "0x27d8" | "base" | "0x2105" | "base sepolia" | "0x14a34" | "optimism" | "0xa" | "holesky" | "0x4268" | "polygon amoy" | "0x13882" | "linea" | "0xe708" | "moonbeam" | "0x504" | "moonriver" | "0x505" | "moonbase" | "0x507" | "linea sepolia" | "0xe705"; +export type EvmChainListValue = "eth" | "0x1" | "sepolia" | "0xaa36a7" | "polygon" | "0x89" | "bsc" | "0x38" | "bsc testnet" | "0x61" | "avalanche" | "0xa86a" | "fantom" | "0xfa" | "palm" | "0x2a15c308d" | "cronos" | "0x19" | "arbitrum" | "0xa4b1" | "chiliz" | "0x15b38" | "chiliz testnet" | "0x15b32" | "gnosis" | "0x64" | "gnosis testnet" | "0x27d8" | "base" | "0x2105" | "base sepolia" | "0x14a34" | "optimism" | "0xa" | "holesky" | "0x4268" | "polygon amoy" | "0x13882" | "linea" | "0xe708" | "moonbeam" | "0x504" | "moonriver" | "0x505" | "moonbase" | "0x507" | "linea sepolia" | "0xe705"; export abstract class EvmChainList { public static create(input: EvmChainListInput | EvmChainListValue): EvmChainListValue { diff --git a/packages/common/evmUtils/src/generated/types/EvmErc20Metadata.ts b/packages/common/evmUtils/src/generated/types/EvmErc20Metadata.ts index 6dd1efe4f5..9de2d87a9e 100644 --- a/packages/common/evmUtils/src/generated/types/EvmErc20Metadata.ts +++ b/packages/common/evmUtils/src/generated/types/EvmErc20Metadata.ts @@ -1,5 +1,6 @@ import { EvmAddress, EvmAddressInput, EvmAddressJSON } from '../../dataTypes'; import { BigNumber, BigNumberInput, BigNumberJSON } from '@moralisweb3/common-core'; +import { EvmErc20MetadataLinks, EvmErc20MetadataLinksValue, EvmErc20MetadataLinksInput, EvmErc20MetadataLinksJSON } from '../types/EvmErc20MetadataLinks'; // $ref: #/components/schemas/erc20Metadata // type: erc20Metadata @@ -12,11 +13,16 @@ import { BigNumber, BigNumberInput, BigNumberJSON } from '@moralisweb3/common-co // - logo ($ref: #/components/schemas/erc20Metadata/properties/logo) // - logo_hash ($ref: #/components/schemas/erc20Metadata/properties/logo_hash) // - thumbnail ($ref: #/components/schemas/erc20Metadata/properties/thumbnail) +// - total_supply ($ref: #/components/schemas/erc20Metadata/properties/total_supply) +// - total_supply_formatted ($ref: #/components/schemas/erc20Metadata/properties/total_supply_formatted) +// - fully_diluted_valuation ($ref: #/components/schemas/erc20Metadata/properties/fully_diluted_valuation) // - block_number ($ref: #/components/schemas/erc20Metadata/properties/block_number) // - validated ($ref: #/components/schemas/erc20Metadata/properties/validated) // - created_at ($ref: #/components/schemas/erc20Metadata/properties/created_at) // - possible_spam ($ref: #/components/schemas/erc20Metadata/properties/possible_spam) // - verified_contract ($ref: #/components/schemas/erc20Metadata/properties/verified_contract) +// - categories ($ref: #/components/schemas/erc20Metadata/properties/categories) +// - links ($ref: #/components/schemas/erc20Metadata/properties/links) export interface EvmErc20MetadataJSON { readonly address: EvmAddressJSON; @@ -27,11 +33,16 @@ export interface EvmErc20MetadataJSON { readonly logo?: string; readonly logo_hash?: string; readonly thumbnail?: string; + readonly total_supply?: string; + readonly total_supply_formatted?: string; + readonly fully_diluted_valuation?: string; readonly block_number?: BigNumberJSON; readonly validated?: number; readonly created_at: string; readonly possible_spam: boolean; readonly verified_contract?: boolean; + readonly categories?: string[]; + readonly links?: EvmErc20MetadataLinksJSON; } export interface EvmErc20MetadataInput { @@ -43,11 +54,16 @@ export interface EvmErc20MetadataInput { readonly logo?: string; readonly logoHash?: string; readonly thumbnail?: string; + readonly totalSupply?: string; + readonly totalSupplyFormatted?: string; + readonly fullyDilutedValuation?: string; readonly blockNumber?: BigNumberInput | BigNumber; readonly validated?: number; readonly createdAt: string; readonly possibleSpam: boolean; readonly verifiedContract?: boolean; + readonly categories?: string[]; + readonly links?: EvmErc20MetadataLinksInput | EvmErc20MetadataLinksValue; } export class EvmErc20Metadata { @@ -68,11 +84,16 @@ export class EvmErc20Metadata { logo: json.logo, logoHash: json.logo_hash, thumbnail: json.thumbnail, + totalSupply: json.total_supply, + totalSupplyFormatted: json.total_supply_formatted, + fullyDilutedValuation: json.fully_diluted_valuation, blockNumber: json.block_number ? BigNumber.fromJSON(json.block_number) : undefined, validated: json.validated, createdAt: json.created_at, possibleSpam: json.possible_spam, verifiedContract: json.verified_contract, + categories: json.categories, + links: json.links ? EvmErc20MetadataLinks.fromJSON(json.links) : undefined, }; return EvmErc20Metadata.create(input); } @@ -109,6 +130,18 @@ export class EvmErc20Metadata { * @description The thumbnail of the logo */ public readonly thumbnail?: string; + /** + * @description Total tokens created minus any that have been burned + */ + public readonly totalSupply?: string; + /** + * @description Total tokens created minus any that have been burned (decimal formatted) + */ + public readonly totalSupplyFormatted?: string; + /** + * @description Fully Diluted Valuation (FDV), this represents the token's Current Price x Total Supply + */ + public readonly fullyDilutedValuation?: string; public readonly blockNumber?: BigNumber; public readonly validated?: number; /** @@ -123,6 +156,14 @@ export class EvmErc20Metadata { * @description Indicates if a contract is verified */ public readonly verifiedContract?: boolean; + /** + * @description Categories of the token + */ + public readonly categories?: string[]; + /** + * @description Social links of the token + */ + public readonly links?: EvmErc20MetadataLinksValue; private constructor(input: EvmErc20MetadataInput) { this.address = EvmAddress.create(input.address); @@ -133,11 +174,16 @@ export class EvmErc20Metadata { this.logo = input.logo; this.logoHash = input.logoHash; this.thumbnail = input.thumbnail; + this.totalSupply = input.totalSupply; + this.totalSupplyFormatted = input.totalSupplyFormatted; + this.fullyDilutedValuation = input.fullyDilutedValuation; this.blockNumber = input.blockNumber ? BigNumber.create(input.blockNumber) : undefined; this.validated = input.validated; this.createdAt = input.createdAt; this.possibleSpam = input.possibleSpam; this.verifiedContract = input.verifiedContract; + this.categories = input.categories; + this.links = input.links ? EvmErc20MetadataLinks.create(input.links) : undefined; } public toJSON(): EvmErc20MetadataJSON { @@ -150,11 +196,16 @@ export class EvmErc20Metadata { logo: this.logo, logo_hash: this.logoHash, thumbnail: this.thumbnail, + total_supply: this.totalSupply, + total_supply_formatted: this.totalSupplyFormatted, + fully_diluted_valuation: this.fullyDilutedValuation, block_number: this.blockNumber ? this.blockNumber.toJSON() : undefined, validated: this.validated, created_at: this.createdAt, possible_spam: this.possibleSpam, verified_contract: this.verifiedContract, + categories: this.categories, + links: this.links ? this.links : undefined, } } } diff --git a/packages/common/evmUtils/src/generated/types/EvmErc20MetadataLinks.ts b/packages/common/evmUtils/src/generated/types/EvmErc20MetadataLinks.ts new file mode 100644 index 0000000000..3dab6d453a --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmErc20MetadataLinks.ts @@ -0,0 +1,16 @@ +// $ref: #/components/schemas/erc20Metadata/properties/links +// typeName: erc20Metadata_links + +export type EvmErc20MetadataLinksJSON = object; +export type EvmErc20MetadataLinksInput = object; +export type EvmErc20MetadataLinksValue = object; + +export abstract class EvmErc20MetadataLinks { + public static create(input: EvmErc20MetadataLinksInput | EvmErc20MetadataLinksValue): EvmErc20MetadataLinksValue { + return input; + } + + public static fromJSON(json: EvmErc20MetadataLinksJSON): EvmErc20MetadataLinksValue { + return json; + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmErc20Price.ts b/packages/common/evmUtils/src/generated/types/EvmErc20Price.ts index 78a93715c1..cff1f66564 100644 --- a/packages/common/evmUtils/src/generated/types/EvmErc20Price.ts +++ b/packages/common/evmUtils/src/generated/types/EvmErc20Price.ts @@ -15,6 +15,7 @@ import { EvmNativeErc20Price, EvmNativeErc20PriceInput, EvmNativeErc20PriceJSON // - exchangeName ($ref: #/components/schemas/erc20Price/properties/exchangeName) // - tokenAddress ($ref: #/components/schemas/erc20Price/properties/tokenAddress) // - toBlock ($ref: #/components/schemas/erc20Price/properties/toBlock) +// - possibleSpam ($ref: #/components/schemas/erc20Price/properties/possibleSpam) // - verifiedContract ($ref: #/components/schemas/erc20Price/properties/verifiedContract) export interface EvmErc20PriceJSON { @@ -30,7 +31,8 @@ export interface EvmErc20PriceJSON { readonly exchangeName?: string; readonly tokenAddress?: string; readonly toBlock?: string; - readonly verifiedContract?: boolean; + readonly possibleSpam: boolean; + readonly verifiedContract: boolean; } export interface EvmErc20PriceInput { @@ -46,7 +48,8 @@ export interface EvmErc20PriceInput { readonly exchangeName?: string; readonly tokenAddress?: string; readonly toBlock?: string; - readonly verifiedContract?: boolean; + readonly possibleSpam: boolean; + readonly verifiedContract: boolean; } export class EvmErc20Price { @@ -71,6 +74,7 @@ export class EvmErc20Price { exchangeName: json.exchangeName, tokenAddress: json.tokenAddress, toBlock: json.toBlock, + possibleSpam: json.possibleSpam, verifiedContract: json.verifiedContract, }; return EvmErc20Price.create(input); @@ -121,10 +125,14 @@ export class EvmErc20Price { * @description toBlock */ public readonly toBlock?: string; + /** + * @description Indicates if a contract is possibly a spam contract + */ + public readonly possibleSpam: boolean; /** * @description Indicates if the contract is verified */ - public readonly verifiedContract?: boolean; + public readonly verifiedContract: boolean; private constructor(input: EvmErc20PriceInput) { this.tokenName = input.tokenName; @@ -139,6 +147,7 @@ export class EvmErc20Price { this.exchangeName = input.exchangeName; this.tokenAddress = input.tokenAddress; this.toBlock = input.toBlock; + this.possibleSpam = input.possibleSpam; this.verifiedContract = input.verifiedContract; } @@ -156,6 +165,7 @@ export class EvmErc20Price { exchangeName: this.exchangeName, tokenAddress: this.tokenAddress, toBlock: this.toBlock, + possibleSpam: this.possibleSpam, verifiedContract: this.verifiedContract, } } diff --git a/packages/common/evmUtils/src/generated/types/EvmNftTradesChainList.ts b/packages/common/evmUtils/src/generated/types/EvmNftTradesChainList.ts new file mode 100644 index 0000000000..08dd07ca61 --- /dev/null +++ b/packages/common/evmUtils/src/generated/types/EvmNftTradesChainList.ts @@ -0,0 +1,16 @@ +// $ref: #/components/schemas/nftTradesChainList +// typeName: nftTradesChainList + +export type EvmNftTradesChainListJSON = "eth" | "0x1" | "polygon" | "0x89" | "bsc" | "0x38" | "avalanche" | "0xa86a" | "arbitrum" | "0xa4b1" | "base" | "0x2105" | "optimism" | "0xa"; +export type EvmNftTradesChainListInput = "eth" | "0x1" | "polygon" | "0x89" | "bsc" | "0x38" | "avalanche" | "0xa86a" | "arbitrum" | "0xa4b1" | "base" | "0x2105" | "optimism" | "0xa"; +export type EvmNftTradesChainListValue = "eth" | "0x1" | "polygon" | "0x89" | "bsc" | "0x38" | "avalanche" | "0xa86a" | "arbitrum" | "0xa4b1" | "base" | "0x2105" | "optimism" | "0xa"; + +export abstract class EvmNftTradesChainList { + public static create(input: EvmNftTradesChainListInput | EvmNftTradesChainListValue): EvmNftTradesChainListValue { + return input; + } + + public static fromJSON(json: EvmNftTradesChainListJSON): EvmNftTradesChainListValue { + return json; + } +} diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts index faf49bc378..f2f41e8de9 100644 --- a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts +++ b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryErc20Transfer.ts @@ -26,7 +26,7 @@ export interface EvmWalletHistoryErc20TransferJSON { readonly token_decimals: string; readonly address: EvmAddressJSON; readonly block_timestamp?: string; - readonly to_address: EvmAddressJSON; + readonly to_address?: EvmAddressJSON; readonly to_address_label?: string; readonly from_address: EvmAddressJSON; readonly from_address_label?: string; @@ -44,7 +44,7 @@ export interface EvmWalletHistoryErc20TransferInput { readonly tokenDecimals: number; readonly address: EvmAddressInput | EvmAddress; readonly blockTimestamp?: string; - readonly toAddress: EvmAddressInput | EvmAddress; + readonly toAddress?: EvmAddressInput | EvmAddress; readonly toAddressLabel?: string; readonly fromAddress: EvmAddressInput | EvmAddress; readonly fromAddressLabel?: string; @@ -71,7 +71,7 @@ export class EvmWalletHistoryErc20Transfer { tokenDecimals: Number(json.token_decimals), address: EvmAddress.fromJSON(json.address), blockTimestamp: json.block_timestamp, - toAddress: EvmAddress.fromJSON(json.to_address), + toAddress: json.to_address ? EvmAddress.fromJSON(json.to_address) : undefined, toAddressLabel: json.to_address_label, fromAddress: EvmAddress.fromJSON(json.from_address), fromAddressLabel: json.from_address_label, @@ -99,7 +99,7 @@ export class EvmWalletHistoryErc20Transfer { /** * @description The recipient */ - public readonly toAddress: EvmAddress; + public readonly toAddress?: EvmAddress; /** * @description The label of the to address */ @@ -140,7 +140,7 @@ export class EvmWalletHistoryErc20Transfer { this.tokenDecimals = input.tokenDecimals; this.address = EvmAddress.create(input.address); this.blockTimestamp = input.blockTimestamp; - this.toAddress = EvmAddress.create(input.toAddress); + this.toAddress = input.toAddress ? EvmAddress.create(input.toAddress) : undefined; this.toAddressLabel = input.toAddressLabel; this.fromAddress = EvmAddress.create(input.fromAddress); this.fromAddressLabel = input.fromAddressLabel; @@ -159,7 +159,7 @@ export class EvmWalletHistoryErc20Transfer { token_decimals: String(this.tokenDecimals), address: this.address.toJSON(), block_timestamp: this.blockTimestamp, - to_address: this.toAddress.toJSON(), + to_address: this.toAddress ? this.toAddress.toJSON() : undefined, to_address_label: this.toAddressLabel, from_address: this.fromAddress.toJSON(), from_address_label: this.fromAddressLabel, diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts index 3ed21c9878..740b2bc317 100644 --- a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts +++ b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryNftTransfer.ts @@ -28,7 +28,7 @@ export interface EvmWalletHistoryNftTransferJSON { readonly token_id: string; readonly from_address: EvmAddressJSON; readonly from_address_label?: string; - readonly to_address: EvmAddressJSON; + readonly to_address?: EvmAddressJSON; readonly to_address_label?: string; readonly value: string; readonly amount: string; @@ -49,7 +49,7 @@ export interface EvmWalletHistoryNftTransferInput { readonly tokenId: string; readonly fromAddress: EvmAddressInput | EvmAddress; readonly fromAddressLabel?: string; - readonly toAddress: EvmAddressInput | EvmAddress; + readonly toAddress?: EvmAddressInput | EvmAddress; readonly toAddressLabel?: string; readonly value: string; readonly amount: string; @@ -79,7 +79,7 @@ export class EvmWalletHistoryNftTransfer { tokenId: json.token_id, fromAddress: EvmAddress.fromJSON(json.from_address), fromAddressLabel: json.from_address_label, - toAddress: EvmAddress.fromJSON(json.to_address), + toAddress: json.to_address ? EvmAddress.fromJSON(json.to_address) : undefined, toAddressLabel: json.to_address_label, value: json.value, amount: json.amount, @@ -116,7 +116,7 @@ export class EvmWalletHistoryNftTransfer { /** * @description The address that received the NFT */ - public readonly toAddress: EvmAddress; + public readonly toAddress?: EvmAddress; /** * @description The label of the to address */ @@ -175,7 +175,7 @@ export class EvmWalletHistoryNftTransfer { this.tokenId = input.tokenId; this.fromAddress = EvmAddress.create(input.fromAddress); this.fromAddressLabel = input.fromAddressLabel; - this.toAddress = EvmAddress.create(input.toAddress); + this.toAddress = input.toAddress ? EvmAddress.create(input.toAddress) : undefined; this.toAddressLabel = input.toAddressLabel; this.value = input.value; this.amount = input.amount; @@ -197,7 +197,7 @@ export class EvmWalletHistoryNftTransfer { token_id: this.tokenId, from_address: this.fromAddress.toJSON(), from_address_label: this.fromAddressLabel, - to_address: this.toAddress.toJSON(), + to_address: this.toAddress ? this.toAddress.toJSON() : undefined, to_address_label: this.toAddressLabel, value: this.value, amount: this.amount, diff --git a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts index f2b7a2f9b0..2e7a608dfe 100644 --- a/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts +++ b/packages/common/evmUtils/src/generated/types/EvmWalletHistoryTransaction.ts @@ -22,6 +22,7 @@ import { EvmNativeTransfer, EvmNativeTransferInput, EvmNativeTransferJSON } from // - 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_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) // - block_number ($ref: #/components/schemas/walletHistoryTransaction/properties/block_number) // - block_hash ($ref: #/components/schemas/walletHistoryTransaction/properties/block_hash) @@ -40,7 +41,7 @@ export interface EvmWalletHistoryTransactionJSON { readonly transaction_index: string; readonly from_address: EvmAddressJSON; readonly from_address_label?: string; - readonly to_address: EvmAddressJSON; + readonly to_address?: EvmAddressJSON; readonly to_address_label?: string; readonly value: string; readonly gas?: string; @@ -49,6 +50,7 @@ export interface EvmWalletHistoryTransactionJSON { readonly receipt_cumulative_gas_used: string; readonly receipt_gas_used: string; readonly receipt_status: string; + readonly transaction_fee?: string; readonly block_timestamp: string; readonly block_number: BigNumberJSON; readonly block_hash: string; @@ -68,7 +70,7 @@ export interface EvmWalletHistoryTransactionInput { readonly transactionIndex: number; readonly fromAddress: EvmAddressInput | EvmAddress; readonly fromAddressLabel?: string; - readonly toAddress: EvmAddressInput | EvmAddress; + readonly toAddress?: EvmAddressInput | EvmAddress; readonly toAddressLabel?: string; readonly value: string; readonly gas?: string; @@ -77,6 +79,7 @@ export interface EvmWalletHistoryTransactionInput { readonly receiptCumulativeGasUsed: string; readonly receiptGasUsed: string; readonly receiptStatus: string; + readonly transactionFee?: string; readonly blockTimestamp: string; readonly blockNumber: BigNumberInput | BigNumber; readonly blockHash: string; @@ -105,7 +108,7 @@ export class EvmWalletHistoryTransaction { transactionIndex: Number(json.transaction_index), fromAddress: EvmAddress.fromJSON(json.from_address), fromAddressLabel: json.from_address_label, - toAddress: EvmAddress.fromJSON(json.to_address), + toAddress: json.to_address ? EvmAddress.fromJSON(json.to_address) : undefined, toAddressLabel: json.to_address_label, value: json.value, gas: json.gas, @@ -114,6 +117,7 @@ export class EvmWalletHistoryTransaction { receiptCumulativeGasUsed: json.receipt_cumulative_gas_used, receiptGasUsed: json.receipt_gas_used, receiptStatus: json.receipt_status, + transactionFee: json.transaction_fee, blockTimestamp: json.block_timestamp, blockNumber: BigNumber.fromJSON(json.block_number), blockHash: json.block_hash, @@ -149,7 +153,7 @@ export class EvmWalletHistoryTransaction { /** * @description The to address */ - public readonly toAddress: EvmAddress; + public readonly toAddress?: EvmAddress; /** * @description The label of the to address */ @@ -167,6 +171,7 @@ export class EvmWalletHistoryTransaction { public readonly receiptCumulativeGasUsed: string; public readonly receiptGasUsed: string; public readonly receiptStatus: string; + public readonly transactionFee?: string; /** * @description The block timestamp */ @@ -206,7 +211,7 @@ export class EvmWalletHistoryTransaction { this.transactionIndex = input.transactionIndex; this.fromAddress = EvmAddress.create(input.fromAddress); this.fromAddressLabel = input.fromAddressLabel; - this.toAddress = EvmAddress.create(input.toAddress); + this.toAddress = input.toAddress ? EvmAddress.create(input.toAddress) : undefined; this.toAddressLabel = input.toAddressLabel; this.value = input.value; this.gas = input.gas; @@ -215,6 +220,7 @@ export class EvmWalletHistoryTransaction { this.receiptCumulativeGasUsed = input.receiptCumulativeGasUsed; this.receiptGasUsed = input.receiptGasUsed; this.receiptStatus = input.receiptStatus; + this.transactionFee = input.transactionFee; this.blockTimestamp = input.blockTimestamp; this.blockNumber = BigNumber.create(input.blockNumber); this.blockHash = input.blockHash; @@ -235,7 +241,7 @@ export class EvmWalletHistoryTransaction { transaction_index: String(this.transactionIndex), from_address: this.fromAddress.toJSON(), from_address_label: this.fromAddressLabel, - to_address: this.toAddress.toJSON(), + to_address: this.toAddress ? this.toAddress.toJSON() : undefined, to_address_label: this.toAddressLabel, value: this.value, gas: this.gas, @@ -244,6 +250,7 @@ export class EvmWalletHistoryTransaction { receipt_cumulative_gas_used: this.receiptCumulativeGasUsed, receipt_gas_used: this.receiptGasUsed, receipt_status: this.receiptStatus, + transaction_fee: this.transactionFee, block_timestamp: this.blockTimestamp, block_number: this.blockNumber.toJSON(), block_hash: this.blockHash, diff --git a/packages/common/evmUtils/src/generated/types/index.ts b/packages/common/evmUtils/src/generated/types/index.ts index 9114675145..f3f0822351 100644 --- a/packages/common/evmUtils/src/generated/types/index.ts +++ b/packages/common/evmUtils/src/generated/types/index.ts @@ -1,9 +1,11 @@ -export * from './EvmChainList'; +export * from './EvmNftTradesChainList'; export * from './EvmGetNFTTradesMarketplaceEnum'; +export * from './EvmChainList'; export * from './EvmGetMultipleTokenPricesIncludeEnum'; export * from './EvmOrderList'; export * from './EvmResolveAddressToDomainCurrencyEnum'; export * from './EvmETransactionCategory'; +export * from './EvmErc20MetadataLinks'; export * from './EvmContractsReviewItemReportTypeEnum'; export * from './EvmContractsReviewItemContractTypeEnum'; export * from './EvmNormalizedMetadataAttributeValue';