Assets API

Documentation for Blockparty Assets API

API Endpoints

COMING SOON

Queries

contract

Response

Returns a Contract

Arguments

Name Description

address - String!

Example

Query
query contract($address: String!) {
  contract(address: $address) {
    address
    assetType
    isERC20
    isERC721
    isERC1155
    tokens {
      ...TokenListFragment
    }
  }
}

Variables

{"address": "abc123"}

Response

{
  "data": {
    "contract": {
      "address": "xyz789",
      "assetType": "ERC1155",
      "isERC20": false,
      "isERC721": true,
      "isERC1155": false,
      "tokens": TokenList
    }
  }
}

contracts

Response

Returns a ContractList!

Arguments

Name Description

first - Int

Default = 10

skip - Int

Default = 0

where - ContractFilter

orderBy - ContractOrderBy

ordering - Ordering

Example

Query
query contracts(
  $first: Int,
  $skip: Int,
  $where: ContractFilter,
  $orderBy: ContractOrderBy,
  $ordering: Ordering
) {
  contracts(
    first: $first,
    skip: $skip,
    where: $where,
    orderBy: $orderBy,
    ordering: $ordering
  ) {
    numEntries
    cursor
    entries {
      ...ContractFragment
    }
  }
}

Variables

{
  "first": 10,
  "skip": 0,
  "where": ContractFilter,
  "orderBy": "ADDRESS",
  "ordering": "ASC"
}

Response

{
  "data": {
    "contracts": {
      "numEntries": UInt64,
      "cursor": UInt64,
      "entries": [Contract]
    }
  }
}

token

Response

Returns a Token

Arguments

Name Description

address - String!

tokenID - UInt256!

Example

Query
query token(
  $address: String!,
  $tokenID: UInt256!
) {
  token(
    address: $address,
    tokenID: $tokenID
  ) {
    contract {
      ...ContractFragment
    }
    tokenID
    mintTransaction {
      ...TransactionFragment
    }
    burnTransaction {
      ...TransactionFragment
    }
  }
}

Variables

{
  "address": "xyz789",
  "tokenID": UInt256
}

Response

{
  "data": {
    "token": {
      "contract": Contract,
      "tokenID": UInt256,
      "mintTransaction": Transaction,
      "burnTransaction": Transaction
    }
  }
}

tokens

Response

Returns a TokenList!

Arguments

Name Description

first - Int

Default = 10

skip - Int

Default = 0

where - TokenFilter

orderBy - TokenOrderBy

ordering - Ordering

whereContract - ContractFilter

Example

Query
query tokens(
  $first: Int,
  $skip: Int,
  $where: TokenFilter,
  $orderBy: TokenOrderBy,
  $ordering: Ordering,
  $whereContract: ContractFilter
) {
  tokens(
    first: $first,
    skip: $skip,
    where: $where,
    orderBy: $orderBy,
    ordering: $ordering,
    whereContract: $whereContract
  ) {
    numEntries
    cursor
    entries {
      ...TokenFragment
    }
  }
}

Variables

{
  "first": 10,
  "skip": 0,
  "where": TokenFilter,
  "orderBy": "ADDRESS",
  "ordering": "ASC",
  "whereContract": ContractFilter
}

Response

{
  "data": {
    "tokens": {
      "numEntries": UInt64,
      "cursor": UInt64,
      "entries": [Token]
    }
  }
}

Types

AssetType

Values

Enum Value Description

ERC1155

ERC721

ERC20

UNKNOWN

Example

"ERC1155"

Boolean

Description

The Boolean scalar type represents true or false.

Example

true

Contract

Fields

Field Name Description

address - String!

assetType - AssetType!

isERC20 - Boolean!

isERC721 - Boolean!

isERC1155 - Boolean!

tokens - TokenList!

Arguments

======= first - Int

======= skip - Int

======= where - TokenFilter

======= orderBy - TokenOrderBy

======= ordering - Ordering

Example

{
  "address": "abc123",
  "assetType": "ERC1155",
  "isERC20": true,
  "isERC721": true,
  "isERC1155": false,
  "tokens": TokenList
}

ContractFilter

Fields

Input Field Description

address - String

assetType - AssetType

isERC20 - Boolean

isERC721 - Boolean

isERC1155 - Boolean

Example

{
  "address": "xyz789",
  "assetType": "ERC1155",
  "isERC20": false,
  "isERC721": false,
  "isERC1155": true
}

ContractList

Fields

Field Name Description

numEntries - UInt64!

cursor - UInt64

entries - [Contract!]!

Example

{
  "numEntries": UInt64,
  "cursor": UInt64,
  "entries": [Contract]
}

ContractOrderBy

Values

Enum Value Description

ADDRESS

Example

"ADDRESS"

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example

123

Ordering

Values

Enum Value Description

ASC

DESC

Example

"ASC"

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example

"xyz789"

Time

Example

"10:15:30Z"

Token

Fields

Field Name Description

contract - Contract!

tokenID - UInt256!

mintTransaction - Transaction

burnTransaction - Transaction

Example

{
  "contract": Contract,
  "tokenID": UInt256,
  "mintTransaction": Transaction,
  "burnTransaction": Transaction
}

TokenFilter

Fields

Input Field Description

address - String

tokenID - UInt256

burned - Boolean

Example

{
  "address": "xyz789",
  "tokenID": UInt256,
  "burned": true
}

TokenList

Fields

Field Name Description

numEntries - UInt64!

cursor - UInt64

entries - [Token!]!

Example

{
  "numEntries": UInt64,
  "cursor": UInt64,
  "entries": [Token]
}

TokenOrderBy

Values

Enum Value Description

ADDRESS

TOKEN_ID

Example

"ADDRESS"

Transaction

Fields

Field Name Description

hash - String!

blockNum - UInt64!

blockTime - Time!

confirmations - UInt64!

contract - Contract!

Example

{
  "hash": "xyz789",
  "blockNum": UInt64,
  "blockTime": "10:15:30Z",
  "confirmations": UInt64,
  "contract": Contract
}

UInt256

Example

UInt256

UInt64

Example

UInt64