-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove support for graphql & update swagger version (#1368)
* remove support for graphql * SERVICES-2711: update Swagger required fields * fix: update property name for locked accounts in TokenSupplyResult * fix: correct type definition for lockedAccounts in TokenSupplyResult * fix: update type definition for lockedAccounts in TokenSupplyResult * fixes * further fixes * fixes after review * update swagger version * remove unnecessary GraphQL field from Token entity --------- Co-authored-by: bogdan-rosianu <bogdan.rosianu@yahoo.com> Co-authored-by: bogdan-rosianu <51945539+bogdan-rosianu@users.noreply.github.com>
- Loading branch information
1 parent
0bbe190
commit 6a03f1f
Showing
223 changed files
with
170 additions
and
9,741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,22 @@ | ||
import { Field, ObjectType } from "@nestjs/graphql"; | ||
import { ObjectType } from "@nestjs/graphql"; | ||
|
||
@ObjectType("AccountAssetsSocial", { description: "Account assets social object type." }) | ||
export class AccountAssetsSocial { | ||
constructor(init?: Partial<AccountAssetsSocial>) { | ||
Object.assign(this, init); | ||
} | ||
|
||
@Field(() => String, { description: "Website asset for the given account asset." }) | ||
website: string = ''; | ||
|
||
@Field(() => String, { description: "Email asset for the given account asset." }) | ||
email: string = ''; | ||
|
||
@Field(() => String, { description: "Blog asset for the given account asset." }) | ||
blog: string = ''; | ||
|
||
@Field(() => String, { description: "Twitter asset for the given account asset." }) | ||
twitter: string = ''; | ||
|
||
@Field(() => String, { description: "Discord asset for the given account asset." }) | ||
discord: string = ''; | ||
|
||
@Field(() => String, { description: "Telegram asset for the given account asset." }) | ||
telegram: string = ''; | ||
|
||
@Field(() => String, { description: "Facebook asset for the given account asset." }) | ||
facebook: string = ''; | ||
|
||
@Field(() => String, { description: "Instagram asset for the given account asset." }) | ||
instagram: string = ''; | ||
|
||
@Field(() => String, { description: "YouTube asset for the given account asset." }) | ||
youtube: string = ''; | ||
|
||
@Field(() => String, { description: "Whitepaper asset for the given account asset." }) | ||
whitepaper: string = ''; | ||
|
||
@Field(() => String, { description: "Coinmarketcap asset for the given account asset." }) | ||
coinmarketcap: string = ''; | ||
|
||
@Field(() => String, { description: "Coingecko asset for the given account asset." }) | ||
coingecko: string = ''; | ||
|
||
@Field(() => String, { description: "Linkedin asset for the given account asset." }) | ||
linkedin: string = ''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
import { Field, Float, ObjectType } from "@nestjs/graphql"; | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
|
||
@ObjectType("NftRank", { description: "NFT rank object type" }) | ||
export class NftRank { | ||
|
||
constructor(init?: Partial<NftRank>) { | ||
if (init) { | ||
Object.assign(this, init); | ||
} | ||
} | ||
|
||
@Field(() => String, { description: 'NFT identifier' }) | ||
@ApiProperty({ type: String }) | ||
identifier: string = ''; | ||
|
||
@Field(() => Float, { description: 'NFT rank' }) | ||
@ApiProperty({ type: Number }) | ||
rank: number = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
import { Field, ObjectType } from "@nestjs/graphql"; | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { TokenAssetsPriceSourceType } from "./token.assets.price.source.type"; | ||
|
||
@ObjectType("TokenAssetsPriceSource", { description: "Token assets price source object type." }) | ||
export class TokenAssetsPriceSource { | ||
@Field(() => String, { description: 'Type of price source', nullable: true }) | ||
@ApiProperty({ type: TokenAssetsPriceSourceType, nullable: true }) | ||
type: TokenAssetsPriceSourceType | undefined = undefined; | ||
|
||
@Field(() => String, { description: 'URL of price source in case of customUrl type', nullable: true }) | ||
@ApiProperty({ type: String, nullable: true }) | ||
url: string | undefined = undefined; | ||
|
||
@Field(() => String, { description: '(Optional) path to fetch the price info in case of customUrl type', nullable: true }) | ||
@ApiProperty({ type: String, nullable: true }) | ||
path: string | undefined = undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,43 @@ | ||
import { Field, ObjectType } from "@nestjs/graphql"; | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
|
||
import GraphQLJSON from "graphql-type-json"; | ||
|
||
import { TokenAssetStatus } from "../../../endpoints/tokens/entities/token.asset.status"; | ||
import { NftRankAlgorithm } from "./nft.rank.algorithm"; | ||
import { TokenAssetsPriceSource } from "./token.assets.price.source"; | ||
|
||
@ObjectType("TokenAssets", { description: "Token assets object type." }) | ||
export class TokenAssets { | ||
constructor(init?: Partial<TokenAssets>) { | ||
Object.assign(this, init); | ||
} | ||
|
||
@Field(() => String, { description: 'Website for the given token assets.' }) | ||
@ApiProperty({ type: String }) | ||
website: string = ''; | ||
|
||
@Field(() => String, { description: 'Description for the given token assets.' }) | ||
@ApiProperty({ type: String }) | ||
description: string = ''; | ||
|
||
@Field(() => String, { description: 'Status for the given token assets.' }) | ||
@ApiProperty({ enum: TokenAssetStatus, default: 'inactive' }) | ||
status: TokenAssetStatus = TokenAssetStatus.inactive; | ||
|
||
@Field(() => String, { description: 'PNG URL for the given token assets.' }) | ||
@ApiProperty({ type: String }) | ||
pngUrl: string = ''; | ||
|
||
@Field(() => String, { description: 'Name for the given token assets.' }) | ||
@ApiProperty({ type: String }) | ||
name: string = ''; | ||
|
||
@Field(() => String, { description: 'SVG URL for the given token assets.' }) | ||
@ApiProperty({ type: String }) | ||
svgUrl: string = ''; | ||
|
||
@Field(() => String, { description: 'Ledger signature for the given token assets.', nullable: true }) | ||
@ApiProperty({ type: String }) | ||
ledgerSignature: string | undefined; | ||
|
||
@Field(() => GraphQLJSON, { description: 'Locked accounts for the given token assets.', nullable: true }) | ||
@ApiProperty({ type: String }) | ||
lockedAccounts: Record<string, string> | undefined = undefined; | ||
|
||
@Field(() => [String], { description: 'Extra tokens for the given token assets.', nullable: true }) | ||
@ApiProperty({ type: String, isArray: true }) | ||
extraTokens: string[] | undefined = undefined; | ||
|
||
@Field(() => String, { description: 'Preferred ranking algorithm for NFT collections. Supported values are "trait", "statistical", "jaccardDistances", "openRarity" and "custom".', nullable: true }) | ||
@ApiProperty({ enum: NftRankAlgorithm, nullable: true }) | ||
preferredRankAlgorithm: NftRankAlgorithm | undefined = undefined; | ||
|
||
@Field(() => TokenAssetsPriceSource, { description: 'Custom price source for the given token', nullable: true }) | ||
@ApiProperty({ enum: TokenAssetsPriceSource, nullable: true }) | ||
priceSource: TokenAssetsPriceSource | undefined = undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
import { Field, Float, ObjectType } from "@nestjs/graphql"; | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { AccountAssets } from "src/common/assets/entities/account.assets"; | ||
|
||
@ObjectType("AccountContract", { description: "Account contract object type." }) | ||
export class AccountContract { | ||
constructor(init?: Partial<AccountContract>) { | ||
Object.assign(this, init); | ||
} | ||
|
||
@Field(() => String, { description: 'Address for the given account.' }) | ||
@ApiProperty({ type: String }) | ||
address: string = ""; | ||
|
||
@Field(() => String, { description: 'DeployTxHash for the given account.' }) | ||
@ApiProperty({ type: String }) | ||
deployTxHash: string = ""; | ||
|
||
@Field(() => Float, { description: 'Timestamp for the given account.' }) | ||
@ApiProperty({ type: Number }) | ||
timestamp: number = 0; | ||
|
||
@Field(() => AccountAssets, { description: 'Assets for the given account.', nullable: true }) | ||
@ApiProperty({ type: AccountAssets, nullable: true, description: 'Contract assets' }) | ||
assets: AccountAssets | undefined = undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,74 @@ | ||
import { ComplexityEstimation } from "@multiversx/sdk-nestjs-common"; | ||
import { Field, ObjectType } from "@nestjs/graphql"; | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { ScamInfo } from "src/common/entities/scam-info.dto"; | ||
import { NftCollectionAccount } from "src/endpoints/collections/entities/nft.collection.account"; | ||
import { NftAccount } from "src/endpoints/nfts/entities/nft.account"; | ||
import { Account } from "./account"; | ||
|
||
@ObjectType("AccountDetailed", { description: "Detailed Account object type that extends Account." }) | ||
export class AccountDetailed extends Account { | ||
constructor(init?: Partial<AccountDetailed>) { | ||
super(); | ||
Object.assign(this, init); | ||
} | ||
|
||
@Field(() => String, { description: 'Code for the given detailed account.' }) | ||
@ApiProperty({ description: 'The source code in hex format' }) | ||
@ApiProperty({ description: 'The source code in hex format', required: false }) | ||
code: string = ''; | ||
|
||
@Field(() => String, { description: 'Code hash for the given detailed account.', nullable: true }) | ||
@ApiProperty({ description: 'The hash of the source code' }) | ||
@ApiProperty({ description: 'The hash of the source code', required: false }) | ||
codeHash: string = ''; | ||
|
||
@Field(() => String, { description: 'Root hash for the given detailed account.', nullable: true }) | ||
@ApiProperty({ description: 'The hash of the root node' }) | ||
rootHash: string = ''; | ||
|
||
@Field(() => String, { description: 'Username for the given detailed account.', nullable: true }) | ||
@ApiProperty({ description: 'The username specific for this account', nullable: true }) | ||
@ApiProperty({ description: 'The username specific for this account', nullable: true, required: false }) | ||
username: string | undefined = undefined; | ||
|
||
@Field(() => String, { description: 'Developer reward for the given detailed account.' }) | ||
@ApiProperty({ description: 'The developer reward' }) | ||
developerReward: string = ''; | ||
|
||
@Field(() => String, { description: 'Owner address for the given detailed account.' }) | ||
@ApiProperty({ description: 'The address in bech 32 format of owner account' }) | ||
@ApiProperty({ description: 'The address in bech 32 format of owner account', required: false }) | ||
ownerAddress: string = ''; | ||
|
||
@Field(() => Boolean, { description: 'If the given detailed account is upgradeable.', nullable: true }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean, required: false }) | ||
isUpgradeable?: boolean; | ||
|
||
@Field(() => Boolean, { description: 'If the given detailed account is readable.', nullable: true }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean, required: false }) | ||
isReadable?: boolean; | ||
|
||
@Field(() => Boolean, { description: 'If the given detailed account is payable.', nullable: true }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean, required: false }) | ||
isPayable?: boolean; | ||
|
||
@Field(() => Boolean, { description: 'If the given detailed account is payable by smart contract.', nullable: true }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean, nullable: true }) | ||
@ApiProperty({ description: 'Specific property flag for smart contract', type: Boolean, nullable: true, required: false }) | ||
isPayableBySmartContract?: boolean | undefined = undefined; | ||
|
||
@Field(() => ScamInfo, { description: 'Scam information for the given detailed account.', nullable: true }) | ||
@ApiProperty({ type: ScamInfo, nullable: true }) | ||
@ApiProperty({ type: ScamInfo, nullable: true, required: false }) | ||
scamInfo: ScamInfo | undefined = undefined; | ||
|
||
@Field(() => [NftCollectionAccount], { description: 'NFT collections for the given detailed account.', nullable: true }) | ||
@ApiProperty({ description: 'Account nft collections', type: Boolean, nullable: true, required: false }) | ||
nftCollections: NftCollectionAccount[] | undefined = undefined; | ||
|
||
@Field(() => [NftAccount], { description: 'NFTs for the given detailed account. Complexity: 1000', nullable: true }) | ||
@ApiProperty({ description: 'Account nfts', type: Boolean, nullable: true, required: false }) | ||
@ComplexityEstimation({ group: 'nfts', value: 1000 }) | ||
nfts: NftAccount[] | undefined = undefined; | ||
|
||
@ApiProperty({ type: Number, nullable: true }) | ||
@ApiProperty({ type: Number, nullable: true, required: false }) | ||
activeGuardianActivationEpoch?: number; | ||
|
||
@ApiProperty({ type: String, nullable: true }) | ||
@ApiProperty({ type: String, nullable: true, required: false }) | ||
activeGuardianAddress?: string; | ||
|
||
@ApiProperty({ type: String, nullable: true }) | ||
@ApiProperty({ type: String, nullable: true, required: false }) | ||
activeGuardianServiceUid?: string; | ||
|
||
@ApiProperty({ type: Number, nullable: true }) | ||
@ApiProperty({ type: Number, nullable: true, required: false }) | ||
pendingGuardianActivationEpoch?: number; | ||
|
||
@ApiProperty({ type: String, nullable: true }) | ||
@ApiProperty({ type: String, nullable: true, required: false }) | ||
pendingGuardianAddress?: string; | ||
|
||
@ApiProperty({ type: String, nullable: true }) | ||
@ApiProperty({ type: String, nullable: true, required: false }) | ||
pendingGuardianServiceUid?: string; | ||
|
||
@ApiProperty({ type: Boolean, nullable: true }) | ||
@ApiProperty({ type: Boolean, nullable: true, required: false }) | ||
isGuarded?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
import { Field, ObjectType } from "@nestjs/graphql"; | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { AccountHistory } from "./account.history"; | ||
|
||
@ObjectType("AccountEsdtHistory", { description: "Account Esdt History object type." }) | ||
export class AccountEsdtHistory extends AccountHistory { | ||
constructor(init?: Partial<AccountEsdtHistory>) { | ||
super(); | ||
Object.assign(this, init); | ||
} | ||
|
||
@Field(() => String, { description: 'Token for the given history account details.' }) | ||
@ApiProperty({ type: String, example: 'WEGLD-bd4d79' }) | ||
token: string = ''; | ||
|
||
@Field(() => String, { description: 'Identifier for the given history account details.' }) | ||
@ApiProperty({ type: String, example: 'XPACHIEVE-5a0519-01' }) | ||
identifier: string | undefined = undefined; | ||
} |
Oops, something went wrong.