Balances API

Documentation for Blockparty Balances API

API Endpoints

COMING SOON

Queries

balance

Response

Returns a Balance

Arguments

Name Description

contract - String!

tokenID - UInt256

account - String

assetType - AssetType

Example

Query
query balance(
  $contract: String!,
  $tokenID: UInt256,
  $account: String,
  $assetType: AssetType
) {
  balance(
    contract: $contract,
    tokenID: $tokenID,
    account: $account,
    assetType: $assetType
  ) {
    type
    contract
    tokenID
    account
    value
  }
}

Variables

{
  "contract": "abc123",
  "tokenID": UInt256,
  "account": "abc123",
  "assetType": "ERC1155"
}

Response

{
  "data": {
    "balance": {
      "type": "ERC1155",
      "contract": "xyz789",
      "tokenID": UInt256,
      "account": "xyz789",
      "value": UInt256
    }
  }
}

balances

Response

Returns a BalanceList!

Arguments

Name Description

first - Int

Default = 10

skip - Int

Default = 0

where - BalanceFilter

orderBy - BalanceOrderBy

ordering - Ordering

Example

Query
query balances(
  $first: Int,
  $skip: Int,
  $where: BalanceFilter,
  $orderBy: BalanceOrderBy,
  $ordering: Ordering
) {
  balances(
    first: $first,
    skip: $skip,
    where: $where,
    orderBy: $orderBy,
    ordering: $ordering
  ) {
    numEntries
    cursor
    entries {
      ...BalanceFragment
    }
  }
}

Variables

{
  "first": 10,
  "skip": 0,
  "where": BalanceFilter,
  "orderBy": "TYPE",
  "ordering": "ASC"
}

Response

{
  "data": {
    "balances": {
      "numEntries": UInt64,
      "cursor": UInt64,
      "entries": [Balance]
    }
  }
}

holders

Response

Returns an UInt64!

Arguments

Name Description

contract - String!

tokenID - UInt256

Example

Query
query holders(
  $contract: String!,
  $tokenID: UInt256
) {
  holders(
    contract: $contract,
    tokenID: $tokenID
  )
}

Variables

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

Response

{"data": {"holders": UInt64}}

Types

AssetType

Values

Enum Value Description

ERC1155

ERC721

ERC20

Example

"ERC1155"

Balance

Fields

Field Name Description

type - AssetType!

contract - String!

tokenID - UInt256

account - String!

value - UInt256

Example

{
  "type": "ERC1155",
  "contract": "abc123",
  "tokenID": UInt256,
  "account": "xyz789",
  "value": UInt256
}

BalanceFilter

Description

Input type for filtering balance data.

Fields

Input Field Description

type - AssetType

account - String

contract - String

contractName - String

tokenID - UInt256

Example

{
  "type": "ERC1155",
  "account": "abc123",
  "contract": "abc123",
  "contractName": "xyz789",
  "tokenID": UInt256
}

BalanceList

Fields

Field Name Description

numEntries - UInt64!

cursor - UInt64

entries - [Balance!]!

Example

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

BalanceOrderBy

Values

Enum Value Description

TYPE

CONTRACT

TOKEN_ID

ACCOUNT

CONTRACT_TOKEN_ID

CONTRACT_ACCOUNT

CONTRACT_TOKEN_ID_ACCOUNT

BLOCK

Example

"TYPE"

Boolean

Description

The Boolean scalar type represents true or false.

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

"abc123"

UInt256

Example

UInt256

UInt64

Example

UInt64