NFT Protocol DEX API
Documentation for NFT Protocol DEX GraphQL API
Queries
balance
Response
Returns a Balance
Arguments
| Name | Description |
|---|---|
|
|
|
|
|
|
|
balances
Response
Returns a Balances!
Arguments
| Name | Description |
|---|---|
|
Default = |
|
Default = |
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
Query
query balances(
$first: Int,
$skip: Int,
$after: String,
$owner: ID!,
$where: BalanceFilter,
$orderBy: BalanceOrderBy,
$orderDirection: OrderDirection,
$whereToken: TokenFilter,
$whereContract: ContractFilter
) {
balances(
first: $first,
skip: $skip,
after: $after,
owner: $owner,
where: $where,
orderBy: $orderBy,
orderDirection: $orderDirection,
whereToken: $whereToken,
whereContract: $whereContract
) {
count
remaining
cursor
balances {
...BalanceFragment
}
}
}
Variables
{
"first": 10,
"skip": 0,
"after": "abc123",
"owner": "4",
"where": BalanceFilter,
"orderBy": "CONTRACT",
"orderDirection": "ASC",
"whereToken": TokenFilter,
"whereContract": ContractFilter
}
contract
Response
Returns a Contract
Arguments
| Name | Description |
|---|---|
|
contracts
Response
Returns a Contracts!
Arguments
| Name | Description |
|---|---|
|
Default = |
|
Default = |
|
|
|
|
|
|
|
Example
Query
query contracts(
$first: Int,
$skip: Int,
$after: String,
$where: ContractFilter,
$orderBy: ContractOrderBy,
$orderDirection: OrderDirection
) {
contracts(
first: $first,
skip: $skip,
after: $after,
where: $where,
orderBy: $orderBy,
orderDirection: $orderDirection
) {
count
remaining
cursor
contracts {
...ContractFragment
}
}
}
Variables
{
"first": 10,
"skip": 0,
"after": "abc123",
"where": ContractFilter,
"orderBy": "ID",
"orderDirection": "ASC"
}
swap
Response
Returns a Swap
Example
Query
query swap(
$dex: String!,
$id: ID!
) {
swap(
dex: $dex,
id: $id
) {
dex {
...DEXFragment
}
id
status
makerAddress
takerAddress
custodial
expirationBlock
paidFee
createdAt
updatedAt
orders {
...OrdersFragment
}
whitelist {
...SwapWhitelistItemsFragment
}
transactions {
...TransactionFragment
}
makerAssetsPresent
expired
}
}
Response
{
"data": {
"swap": {
"dex": DEX,
"id": "4",
"status": "OPEN",
"makerAddress": "xyz789",
"takerAddress": "xyz789",
"custodial": false,
"expirationBlock": UInt64,
"paidFee": "xyz789",
"createdAt": "10:15:30Z",
"updatedAt": "10:15:30Z",
"orders": Orders,
"whitelist": SwapWhitelistItems,
"transactions": [Transaction],
"makerAssetsPresent": false,
"expired": true
}
}
}
swaps
Response
Returns a Swaps!
Arguments
| Name | Description |
|---|---|
|
Default = |
|
Default = |
|
|
|
|
|
|
|
Example
Query
query swaps(
$first: Int,
$skip: Int,
$after: String,
$where: SwapFilter,
$orderBy: SwapOrderBy,
$orderDirection: OrderDirection
) {
swaps(
first: $first,
skip: $skip,
after: $after,
where: $where,
orderBy: $orderBy,
orderDirection: $orderDirection
) {
count
remaining
cursor
swaps {
...SwapFragment
}
}
}
Variables
{
"first": 10,
"skip": 0,
"after": "xyz789",
"where": SwapFilter,
"orderBy": "ID",
"orderDirection": "ASC"
}
token
Response
Returns a Token
Example
Query
query token(
$contract: ID!,
$tokenID: ID!
) {
token(
contract: $contract,
tokenID: $tokenID
) {
contract {
...ContractFragment
}
tokenID
tokenURI
tokenURIStatus
image {
...ImageFragment
}
metadataStatus
metadataContent
metadataContentType
createdAt
createdBlock
burnedAt
burnedBlock
errorMsg
name
description
expired
dexTrades
holders {
...BalancesFragment
}
}
}
Response
{
"data": {
"token": {
"contract": Contract,
"tokenID": "xyz789",
"tokenURI": "abc123",
"tokenURIStatus": "OK",
"image": Image,
"metadataStatus": "OK",
"metadataContent": "abc123",
"metadataContentType": "abc123",
"createdAt": "10:15:30Z",
"createdBlock": 987,
"burnedAt": "10:15:30Z",
"burnedBlock": 123,
"errorMsg": "xyz789",
"name": "xyz789",
"description": "abc123",
"expired": true,
"dexTrades": 987,
"holders": Balances
}
}
}
tokenCount
Response
Returns an UInt64!
Arguments
| Name | Description |
|---|---|
|
|
|
|
|
tokens
Response
Returns a Tokens!
Arguments
| Name | Description |
|---|---|
|
Default = |
|
Default = |
|
|
|
|
|
|
|
|
|
|
|
Example
Query
query tokens(
$first: Int,
$skip: Int,
$after: String,
$where: TokenFilter,
$orderBy: TokenOrderBy,
$orderDirection: OrderDirection,
$whereContract: ContractFilter,
$whereSwap: SwapFilter
) {
tokens(
first: $first,
skip: $skip,
after: $after,
where: $where,
orderBy: $orderBy,
orderDirection: $orderDirection,
whereContract: $whereContract,
whereSwap: $whereSwap
) {
count
cursor
tokens {
...TokenFragment
}
timing
}
}
Types
Balances
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
Contract
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Arguments======= ======= ======= ======= ======= ======= |
ContractFilter
Fields
| Input Field | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Contracts
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
ERC1155Order
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ERC20Order
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
ERC721Order
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
EtherOrder
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
ID
Description
The ID scalar type represents a unique identifier, often used to
refetch an object or as a key for a cache. The ID type appears in a JSON
response as a String; however, it is not intended to be human-readable.
When expected as an input type, any string (such as "4") or integer
(such as 4) input value will be accepted as an ID.
Image
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Arguments======= ======= ======= |
|
|
|
|
Int
MetadataStatus
OrderFilter
Fields
| Input Field | Description |
|---|---|
|
|
|
|
|
|
|
Orders
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
String
Swap
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Arguments======= ======= ======= ======= ======= ======= |
|
|
|
Arguments======= ======= ======= ======= ======= |
|
|
|
Arguments======= ======= ======= |
|
|
|
|
Example
{
"dex": DEX,
"id": 4,
"status": "OPEN",
"makerAddress": "abc123",
"takerAddress": "xyz789",
"custodial": false,
"expirationBlock": UInt64,
"paidFee": "xyz789",
"createdAt": "10:15:30Z",
"updatedAt": "10:15:30Z",
"orders": Orders,
"whitelist": SwapWhitelistItems,
"transactions": [Transaction],
"makerAssetsPresent": true,
"expired": false
}
SwapDroppedEvent
Fields
| Field Name | Description |
|---|---|
|
|
|
SwapEtherAmendedEvent
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwapFilter
Fields
| Input Field | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
{
"dex": "abc123",
"status": "OPEN",
"status_in": ["OPEN"],
"maker_or_taker": "abc123",
"maker": "xyz789",
"taker": "abc123",
"order": OrderFilter,
"whitelist_has": "xyz789",
"whitelist_empty": true,
"whitelist_empty_or_has": "xyz789",
"bundle": true,
"asset_type": "ERC1155",
"asset_type_make": "ERC1155",
"asset_type_take": "ERC1155",
"asset_type_either": "ERC1155",
"account_can_take": "abc123",
"custodial": false,
"expired": false,
"closed_or_expired": false
}
SwapMadeEvent
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
SwapTakenEvent
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
SwapWhitelistItems
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
Thumbnail
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
ThumbnailFilter
Fields
| Input Field | Description |
|---|---|
|
ThumbnailPreset
Token
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
{
"contract": Contract,
"tokenID": "xyz789",
"tokenURI": "xyz789",
"tokenURIStatus": "OK",
"image": Image,
"metadataStatus": "OK",
"metadataContent": "abc123",
"metadataContentType": "abc123",
"createdAt": "10:15:30Z",
"createdBlock": 987,
"burnedAt": "10:15:30Z",
"burnedBlock": 987,
"errorMsg": "xyz789",
"name": "abc123",
"description": "abc123",
"expired": false,
"dexTrades": 123,
"holders": Balances
}
TokenFilter
Fields
| Input Field | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TokenOrderBy
Transaction
Fields
| Field Name | Description |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|