NFT Trader
Ask or search…
K

PostClient

Glossary of the types and interfaces related to the PostClient class

Index

CreatePost

type CreatePost = {
assets: CreatePostAssets
expirationDate: number
messages: Array<{ type: string }>
networkId: string
type: PostType[PostTypeName]
creatorAddress: string
}

CreatePostReply

type CreatePostReply = {
creatorAddress: string
messages: Array<{ type: string }>
assets: CreatePostAssets
networkId: string
parentId: string
}

ListPostsFilters

interface ListPostsFilters {
owner?: string
collections?: Array<{ address: string; network: Network }>
status?: PostStatusName | PostStatus[PostStatusName]
type?: PostTypeName | PostType[PostTypeName]
typeOffered?: BitmapOffered
typeWanted?: BitmapWanted
verified?: boolean
network?: Network
offers?: number
expirationDate?: number
includeParent?: boolean
}

ListPostsOrder

interface ListPostsOrder {
field: "creationDate" | "expirationDate" | "assetsOffered" | "assetsWanted"
direction?: "ASC" | "DESC"
}

ListPostsResponse

interface ListPostsResponse {
posts: Array<Post>
total: number
}

Collection

interface Collection {
name: string
statusVerification: 0 | 1 | 2
address: string
imageUrl: string
networkId: string
abi: Array<any>
type: "ERC721" | "ERC1155" | "ERC20" | "NATIVE"
symbol: string
createdAt: Maybe<string>
isFavourite?: 0 | 1
notification?: boolean
}

Post

interface Post {
id: string
parentId: string | null
status: PostStatus[PostStatusName]
type: PostType[PostTypeName]
creationDate: number
networkId: string
creator: Collector
messages: Array<{ type: string }>
assets: PostAssets
isCreator: boolean
score?: number
isDifferent?: boolean
like?: number
typeWanted?: string
typeOffered?: string
accepted?: boolean
expirationDate?: number
numberOffers?: number
numberOffersRead?: number
parent?: Post | null
}

PostAssets

interface PostAssets {
wanted?: PostAsset[]
offered?: PostAsset[]
}

PostAsset

interface PostAsset {
name: string
statusVerification: 0 | 1 | 2
address: string
imageUrl: string
networkId: string
abi: Maybe<Array<any>>
type: "ERC721" | "ERC1155" | "ERC20" | "NATIVE"
isNft: boolean
symbol: string
createdAt: Maybe<string>
tokenId: Maybe<string>
amount: Maybe<string>
amountHumanReadable: Maybe<string>
isDifferent: boolean
collection?: Collection
}

PostLike

interface PostLike {
id: string
parentId: Maybe<string>
status: PostStatus[PostStatusName]
type: PostType[PostTypeName]
creationDate: number
networkId: string
creator: Collector
messages: Array<{ type: string }>
assets: CreatePostAssets
typeWanted: string
typeOffered: string
expirationDate: Maybe<number>
}

PostStatus

type PostStatus = Record<PostStatusName, PostStatusValue>

PostType

type PostType = Record<PostTypeName, PostTypeValue>

PostStatusName

type PostStatusName =
| "ACTIVE"
| "COMPLETED"
| "EXPIRED"
| "CANCELED"
| "RESERVED"

PostTypeValue

type PostTypeValue = "A1" | "A2" | "B1" | "B2" | "C1" | "R1"

PostTypeName

type PostTypeName =
| "ACTIVE"
| "COMPLETED"
| "EXPIRED"
| "CANCELED"
| "RESERVED"

PostStatusValue

type PostStatusValue = 0 | 1 | 2 | 3 | 4 | 5

POST_STATUS

const POST_STATUS: PostStatus = {
ACTIVE: 0,
COMPLETED: 1,
EXPIRED: 2,
CANCELED: 3,
RESERVED: 4,
}

POST_TYPE

const POST_TYPE: PostType = {
A1: 0,
A2: 1,
B1: 2,
B2: 3,
C1: 4,
R1: 5,
}

Maybe

type Maybe<T> = T | null