NFT Trader
Ask or search…
K

TradeClient

Glossary of the types and interfaces related to the TradeClient class

Index

CreateTradePeer

type CreateTradePeer<Additional extends Record<string, any> = {}> = {
/**
* The assets (NATIVE/ERC20/ERC721/ERC1155) provided.
*
* @defaultValue []
*/
assets?: Array<Asset>
} & Additional

TradeClientErrorTypeMap

interface TradeClientErrorTypeMap {
execTradeTransactionError: "execTradeTransactionError"
execTradeError: "execTradeError"
cancelTradeTransactionError: "cancelTradeTransactionError"
cancelTradeError: "cancelTradeError"
}

TradeClientEventError

interface TradeClientEventError<
EventName extends keyof TradeClientErrorTypeMap
> {
error: any
typeError: "waitError" | "ApiError" | TradeClientErrorTypeMap[EventName]
}

TradeClientEventsMap

interface TradeClientEventsMap {
cancelTradeTransactionCreated: (p: { tx: TransactionMethods<boolean> }) => any
cancelTradeTransactionMined: (p: {
receipt: ethers.providers.TransactionReceipt
}) => any
cancelTradeTransactionError: (
p: TradeClientEventError<"cancelTradeTransactionError">
) => any
cancelTradeError: (p: TradeClientEventError<"cancelTradeError">) => any
execTradeTransactionCreated: (p: {
tx: ethers.providers.TransactionResponse
}) => any
execTradeTransactionMined: (p: {
receipt: ethers.providers.TransactionReceipt
}) => any
execTradeTransactionError: (
p: TradeClientEventError<"execTradeTransactionError">
) => any
execTradeError: (p: TradeClientEventError<"execTradeError">) => any
}

Fee

import { Fee as _Fee } from "@opensea/seaport-js/lib/types"
type Fee = _Fee

GetGlobalTradesListResponse

interface GetGlobalTradesListResponse {
tradeList: Array<TradeOrder>
count: number
}

GetUserTradesListResponse

interface GetUserTradesListResponse {
tradeList: Array<TradeOrder>
count: number
}

Trade

import { OrderWithCounter } from "@opensea/seaport-js/lib/types"
type Trade = OrderWithCounter & { hash: string }

Deal (DealDetail, DealMaster, TradeDetail)

type DealDetail = {
blc: string | null
blcNative: number
blcPercentage: string
blcPercentageNative: number
collectionAddress: string
collectionLogo: string
creator: 0 | 1
networkId: string
imageUrl: string
isImg: 0 | 1
name: string | null
statusVerification: 0 | 1 | 2
swapId: string
symbol: string
tokenId: string | null
tokenUSDValue: number
type: "ERC721" | "ERC20" | "ERC1155" | "NATIVE"
}
type DealMaster = {
imageUrl: string
name: string
symbol: string
valueMaker: string
valueTaker: string
flatFeeMaker: string
flatFeeMakerNative: number
flatFeeTaker: string
flatFeeTakerNative: number
percentageFeeMaker: string
percentageFeeMakerNative: number
percentageFeeTaker: string
percentageFeeTakerNative: number
swapStatus: number
}
type TradeDetail = {
master: Array<DealMaster>
detail: Array<DealDetail>
parameters: {
addressMaker: string
addressTaker: string
order: {
orderHash: string
parameters: TradeParameters
signature: string
}
}
}

TradeOrder

interface TradeOrder {
networkId: string
swapId: string
swapStatus: 0 | 1 | 2
txHash: string
addressMaker: string
usernameMaker: Maybe<string>
valueMaker: string
addressTaker: string
usernameTaker: Maybe<string>
valueTaker: string
name: string
symbol: string
imageUrl: string
swapStart: string
swapEnd: string
type: "DIRECT_DEAL" | "PUBLIC_DEAL"
maker: Array<Collector>
taker: Array<Collector>
collections: Array<{
creator: 0 | 1
networkId: string
collectionAddress: string
abi: Array<any>
name: string
symbol: string
assetLogo: string
type: "ERC721" | "ERC1155" | "ERC20" | "NATIVE"
statusVerification: 0 | 1 | 2
}>
}

TradeParameters

import { OrderWithCounter } from "@opensea/seaport-js/lib/types"
type TradeParameters = OrderWithCounter["parameters"]

WithAddress

type WithAddress = {
address: string
}

Collector

interface Collector {
username: string
address: string
imageUrl: string
isVerified: 0 | 1
isNft: 0 | 1
networkId?: string
isFavourite?: 0 | 1
isRegistered?: 0 | 1
}

Network

type Network =
| "1"
| "5"
| "10"
| "42"
| "56"
| "69"
| "100"
| "137"
| "42161"
| "42170"
| "43113"
| "43114"
| "80001"
| "421611"
| "11155111"

Maybe

type Maybe<T> = T | null