# OneSource Web3 API Documentation
> Complete API reference and guides for the OneSource Web3 API - GraphQL-based blockchain data access for Ethereum, Base, Optimism, and more.
This file contains all documentation content in a single document following the llmstxt.org standard.
## Account Access
import React, { useEffect } from 'react';
import BrowserOnly from '@docusaurus/BrowserOnly';
import ZoomImage from '@site/src/components/ZoomImage';
Your OneSource account dashboard can be accessed via the [Sign In](https://app.onesource.io/login) page.
:::tip
If you have not yet registered a OneSource account, you can do so by following the steps detailed in [Get an API Key](./getting-started/get-an-api-key).
:::
Enter the email address with which you registered and click **Send link**. An email containing a link to log in to your account will be distributed to the provided email address. Click the link in the email and you will be taken to your OneSource account dashboard.
Via your OneSource dashboard you can:
- View your existing API key(s)
- Create a new API key
- Check the status of your subscription plan and API keys
- View your current cycle utilization
---
## Getting Started
## [Subscription Plans](subscription-plans)
OneSource is currently available through a free subscription plan.
## [Get an API Key](get-an-api-key)
Create an account and get an API key via OneSource.io or AWS Marketplace.
## [Authentication](authentication)
Making OneSource API calls requires proper authentication with an API key.
## [Playgrounds](playgrounds)
Create your first query using a GraphQL playground.
---
## Authentication
To access the OneSource API, you need to include an API key in your requests. The API key is passed as an HTTP header.
## API Key Format
Your API key follows this format:
```plaintext
x-bp-token: BP-{KEYVALUE}
```
* `x-bp-token`: This is the header key used to pass the API key.
* `BP-{KEYVALUE}`: This is the API key value, where `{KEYVALUE}` is a unique 26 character alphanumeric string provided to you via your OneSource dashboard.
import React from 'react';
import ZoomImage from '@site/src/components/ZoomImage';
## How to Use the API Key
Include the API key in the headers of your HTTP requests. Here's an example using `curl`:
```bash
curl -X GET "https://api.e2.onesource.io/federation/ethereum/graphql" \
-H "x-bp-token: BP-12345678912345678912345678"
```
Replace `BP-12345678912345678912345678` with your actual API key.
***
## Getting Your API Key
Refer to [Get an API Key](get-an-api-key) for information on how to obtain an API key.
***
## Best Practices
* **Keep your API key secure**: Do not share your API key publicly or commit it to version control systems like GitHub.
* **Rotate keys regularly**: For enhanced security, rotate your API keys periodically.
* **Use environment variables**: Store your API key in environment variables to avoid hardcoding it in your application.
***
## Troubleshooting
If you receive a `status code 401` or `Invalid API token` error, double-check that:
* The API key is correctly formatted (`x-bp-token: BP-{KEYVALUE}`).
* The API key is included in the requests header.
* The API key is valid and has not expired. You can check this via your OneSource dashboard.
---
## Get an API Key
To get started with OneSource, you must first obtain an API key.
import React, { useEffect } from 'react';
import BrowserOnly from '@docusaurus/BrowserOnly';
import ZoomImage from '@site/src/components/ZoomImage';
{() => {
const { useEffect } = require('react');
const useAnchorScroll = () => {
useEffect(() => {
const hash = window.location.hash;
if (hash) {
const element = document.getElementById(hash.substring(1));
if (element) {
setTimeout(() => {
element.scrollIntoView();
}, 100);
}
}
}, []);
};
useAnchorScroll();
return null;
}}
## Create a OneSource Account
Navigate to the [Sign Up](https://app.onesource.io/signup) page to create your OneSource account.
Enter your name, email address and organization (agreeing to receive emails from OneSource is optional) and click **Get Started**.
An email containing a sign in link will be sent to the provided email address. Click **Get Started Now** in the email to be taken to your OnceSource account dashboard.
## The OneSource Account Dashboard
The OneSource account dashboard is where you can view important account information such as license details, billing date, current billing cycle utilization, plan status and your API keys.
## Create an API Key
To create an API key, click on **API Keys** in the sidebar on the left.
Click the **Create new API key +** button in the upper right corner to generate a new API key.
Your new API key will appear in the table of API keys. You can create and remove API keys from your account as needed.
## Alternative: AWS Marketplace
OneSource is also available through the [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-at5xou6obw4s4).
This method of account creation may be preferable for those who already utilize the AWS Marketplace.
### Create or Sign In to an AWS Account
If you do not yet have an AWS account, you will need to [create one](https://signin.aws.amazon.com/signup?request_type=register). If you already have an AWS account, you will need to [sign in](https://aws.amazon.com/marketplace/login).
### Review Subscription Options and Confirm Subscription
Once you've signed into your AWS account, return to [OneSource Web3 API on AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-at5xou6obw4s4) and click the **View purchase options** button.
Select your auto-renewal preference and then scroll down to 'Pricing details and unit configuration'. Select your desired subscription tier and then click the **Subscribe** button to finalize your subscription. Refer to the [Subscription Plans](subscription-plans) page for more information on subscriptions.
### Set up OneSource Account
It will take a couple of minutes for AWS Marketplace to complete your subscription. When your subscription is complete, click the **Set up your account** button to be taken to the OneSource [Sign Up](https://app.onesource.io/signup) page.
Proceed with account creation as described in the [Create a OneSource Account](#create-a-onesource-account) section above.
---
## Playgrounds
Playgrounds are interactive environments where you can test and explore our GraphQL API in real-time. Whether you just want to give OneSource Web3 API a try or you're experimenting with queries and debugging responses, playgrounds provide a user-friendly interface to help you get the most out of our API.
## [GraphiQL Playground](graphiql)
The embedded GraphiQL Playground allows you to explore the OneSource Web3 API Ethereum endpoint without leaving this documentation and without your own API key. This is a great option for those who simply want to give OneSource a try.
## [Apollo Sandbox](apollo)
Apollo Sandbox provides a full-featured playground experience with an interactive query builder.
---
## Apollo Sandbox
import React, { useEffect } from 'react';
import BrowserOnly from '@docusaurus/BrowserOnly';
import ZoomImage from '@site/src/components/ZoomImage';
import ManualContent from './examples.mdx'
### Key Features
* **Interactive Query Builder**: Build queries by selecting arguments and fields from the schema documentation.
* **Comprehensive Documentation**: Auto-generated documentation for all types and queries including field descriptions.
* **Debugging Tools**: Pretty-printed JSON results with collapsible sections and detailed error messages with path highlighting.
### Accessing Apollo Sandbox
This [link](https://studio.apollographql.com/sandbox/explorer?endpoint=https%3A%2F%2Fapi.onesource.io%2Ffederation%2Fethereum%2Fgraphql&headers=%7B%22x-bp-token%22%3A%22BP-%7BKEYVALUE%7D%22%7D) loads Apollo Sandbox pre-configured with the OneSource Web3 API Ethereum [endpoint](onesource-web3-api-reference/README.md#graphql-endpoints) and header key.
Simply replace `BP-{KEYVALUE}` in the **Headers** tab with your [API key value](/getting-started/authentication#api-key-format) (`BP-{KEYVALUE}` only) and you're ready to begin.
### Using Apollo Sandbox
Although the above link to Apollo Sandbox is not pre-configured with query templates, it is quite easy to build your own queries with the Apollo Sandbox interactive query builder.
***
:::warning
It is important to note that Apollo Sandbox by default polls the connected endpoint for schema changes every 5 seconds. Each poll is counted by OneSource as a request against your API key. You may wish to disable this feature so as to conserve your requests, particularly if you intend to be working with the Apollo Sandbox for extended periods of time.
This setting can be disabled by navigating to the **settings** where you can edit the **Connection settings**. In the **Connection settings** menu, toggle the **Auto Update** feature to the **OFF** position as shown below.
:::
### Other Features
Apollo Sandbox allows you to retain and reference your history and browse the schema just like the OneSource Playground. You can access these features as shown below.
---
## Example Queries
## Query Templates
Use these query templates to get acquainted with OneSource.
Please refer to the [OneSource Web3 API Reference](onesource-web3-api-reference/README.md) for comprehensive documentation of all available queries to use as guidance when building your own queries.
### Get ERC-20 Token Details
This query fetches all available data about a given ERC-20 token contract.
```graphql
query Contract($contractId: ID!) {
contract(id: $contractId) {
id
type
name
symbol
decimals
createdAt
createdBlock
holders
}
}
```
Variables
```json
{
"contractId": "contract-address-here"
}
```
### Get NFT Token Details
This query fetches the name, description, medium thumbnail image, and contract address and type of a given NFT token.
```graphql
query Token($contract: ID!, $tokenID: ID!) {
token(contract: $contract, tokenID: $tokenID) {
name
description
image {
thumbnails(where: { preset: MEDIUM }) {
url
}
}
contract {
id
isERC721
isERC1155
}
}
}
```
Variables
```json
{
"contract": "NFT-contract-address-here",
"tokenID": "123"
}
```
### Get NFT Token Details With Image
This query fetches the name, symbol, and type of an NFT contract as well as its token URI and every available media thumbnail size with dimensions and type of each.
```graphql
query GetTokenWithImage(
$contract: ID!
$tokenID: ID!
) {
token(
contract: $contract
tokenID: $tokenID
) {
contract {
id
type
name
symbol
decimals
}
tokenID
tokenURI
tokenURIStatus
image {
status
url
contentType
width
height
thumbnails {
preset
status
url
width
height
contentType
createdAt
}
createdAt
errorMsg
}
createdAt
createdBlock
}
}
```
Variables
```json
{
"contract": "NFT-contract-address-here",
"tokenID": "123"
}
```
### Get Wallet Token Balance
This query fetches a wallet's balance of a given ERC-20 token contract as well as the ERC-20 token contract's name, symbol and type. This query could be amended for an ERC-721 or ERC-1155 token by adding the `tokenID` argument to the query and variables.
```graphql
query Balance($owner: ID!, $contract: ID!) {
balance(owner: $owner, contract: $contract) {
value
contract {
name
symbol
}
contractType
owner
}
}
```
Variables
```json
{ "owner": "wallet-address-here",
"contract": "erc-20-contract-address-here"
}
```
### Get All Tokens With Name Containing a Word
This query fetches all tokens with a name containing a word or string of characters.
```graphql
query Contracts($where: ContractFilter) {
contracts(where: $where) {
contracts {
name
symbol
type
id
}
}
}
```
Variables
```json
{
"where": {
"name_like": "word-here"
}
}
```
---
## GraphiQL Playground
import GraphQLPlayground from '@site/src/components/GraphQLPlayground';
import GraphiQLurlGenerator from '@site/src/components/GraphiQLurlGenerator';
import ManualContent from './examples.mdx'
import BrowserOnly from '@docusaurus/BrowserOnly';
{() => {
const { useEffect } = require('react');
const useAnchorScroll = () => {
useEffect(() => {
const hash = window.location.hash;
if (hash) {
const element = document.getElementById(hash.substring(1));
if (element) {
setTimeout(() => {
element.scrollIntoView();
}, 100);
}
}
}, []);
};
useAnchorScroll();
return null;
}}
This embedded playground allows you to submit any query to the OneSource Web3 API Ethereum endpoint and get a real-time response without needing your own API key.
---
## Subscription Plans
| Sandbox |
|---------|
| $0/month1 request/second1M requests/month |
:::info
GraphQL APIs like OneSource are typically able to deliver the data you need in fewer requests than REST APIs.
:::
Proceed to [Get an API Key](get-an-api-key) or visit our [Sign Up](https://www.onesource.io/signup) page to get started with our free subscription plan.
---
## Guides
## [Integrating OneSource Queries](integrating-onesource-queries)
Tips for integrating OneSource queries into your project.
## [Working with API Responses](working-with-api-responses)
Tips for working with API responses received from the OneSource Web3 API.
## [Troubleshooting](troubleshooting)
Tips for resolving common issues when working with the OneSource Web3 API.
---
## Integrating OneSource Queries
There are many ways to integrate OneSource GraphQL queries into your project. The method you choose should be based on the needs of your specific project.
This guide contains examples of how to integrate OneSource queries into your project using a handful of popular programming languages and tools.
## JavaScript (Fetch API)
```javascript
const apiKey = "BP-XXXXXXXXXXXXXXXXXXXXXXXXXX";
const query = `
query Token($contract: ID!, $tokenID: ID!) {
token(contract: $contract, tokenID: $tokenID) {
name
description
image {
thumbnails(where: { preset: MEDIUM }) {
url
}
}
contract {
id
isERC721
isERC1155
}
}
}
`;
const variables = {
contract: "NFT-contract-address-here",
tokenID: "123"
};
fetch("https://api.onesource.io/federation/ethereum/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-bp-token": apiKey
},
body: JSON.stringify({
query,
variables
})
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
```
## JavaScript (Axios)
```javascript
const axios = require("axios");
const apiKey = process.env.ONE_SOURCE_API_KEY;
const query = `
query Token($contract: ID!, $tokenID: ID!) {
token(contract: $contract, tokenID: $tokenID) {
name
description
image {
thumbnails(where: { preset: MEDIUM }) {
url
}
}
contract {
id
isERC721
isERC1155
}
}
}
`;
const variables = {
contract: "NFT-contract-address-here",
tokenID: "123"
};
axios.post(
"https://api.onesource.io/federation/ethereum/graphql",
{
query,
variables
},
{
headers: {
"Content-Type": "application/json",
"x-bp-token": apiKey
}
}
)
.then((response) => console.log(response.data))
.catch((error) => console.error("Error:", error));
```
## Python (Requests)
```python
import requests
import os
api_key = os.getenv("ONE_SOURCE_API_KEY")
url = "https://api.onesource.io/federation/ethereum/graphql"
query = """
query Token($contract: ID!, $tokenID: ID!) {
token(contract: $contract, tokenID: $tokenID) {
name
description
image {
thumbnails(where: { preset: MEDIUM }) {
url
}
}
contract {
id
isERC721
isERC1155
}
}
}
"""
variables = {
"contract": "NFT-contract-address-here",
"tokenID": "123"
}
headers = {
"Content-Type": "application/json",
"x-bp-token": api_key
}
response = requests.post(url, json={"query": query, "variables": variables}, headers=headers)
print(response.json())
```
## GraphQL Clients (Apollo)
```javascript
import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client";
import { gql } from '@apollo/client';
const client = new ApolloClient({
link: new HttpLink({
uri: "https://api.onesource.io/federation/ethereum/graphql",
headers: { "x-bp-token": process.env.API_KEY }
}),
cache: new InMemoryCache()
});
const GET_TOKEN_DETAILS = gql`
query Token($contract: ID!, $tokenID: ID!) {
token(contract: $contract, tokenID: $tokenID) {
name
description
image {
thumbnails(where: { preset: MEDIUM }) {
url
}
}
contract {
id
isERC721
isERC1155
}
}
}
`;
const variables = {
contract: "NFT-contract-address-here",
tokenID: "123"
};
client.query({ query: GET_TOKEN_DETAILS, variables })
.then((result) => console.log(result.data))
.catch((error) => console.error("Error:", error));
```
## Best Practices
### Using Environment Variables for API Keys
To securely store and use your API key, we recommend using environment variables. This prevents hardcoding sensitive information in your code and makes it easier to manage keys across different environments.
#### Step 1: Set the Environment Variable
* **For Local Development**: Create a `.env` file and add your API key (or set the environment variable in your system).
Create a `.env` file:
```text
API_KEY=BP-12345678912345678912345678
```
Set the environment variable in your system:
```bash
export API_KEY=BP-12345678912345678912345678
```
* **For Production**: Use a secret management tool like AWS Secrets Manager or Azure Key Vault.
#### Step 2: Access the Environment Variable
**JavaScript**:
```javascript
const apiKey = process.env.API_KEY;
```
**Python**:
```python
import os
api_key = os.getenv("API_KEY")
```
### Handle Errors Gracefully
Check for errors in the response and provide meaningful feedback.
### Optimize Queries
Use only the query fields you need to reduce response size and improve performance in your project.
## Other Ways to Use GraphQL
### Relay (React)
Relay is a high-performance GraphQL client for React.
### Server-Side Frameworks
Integrate GraphQL into server-side applications using frameworks like Express (Node.js) or Django (Python).
### Mobile Development
Use GraphQL in mobile apps with Apollo Client (React Native) or Relay.
### Static Site Generators
Fetch data at build time or runtime in static sites built with Next.js or Gatsby.
### Low-Code/No-Code Platforms
Integrate GraphQL into platforms like Zapier, Make or Retool.
---
## Troubleshooting
This guide helps you resolve common issues when working with the OneSource Web3 API.
## Authentication Errors
### `Invalid API token` or `Status Code 401`
If you receive this error:
1. Check API key format to ensure your key starts with `BP-` followed by 26 characters (i.e., `BP-12345678912345678912345678`).
2. Verify header implementation:
```jsx
// Correct implementation
headers: {
"Content-Type": "application/json",
"x-bp-token": "BP-12345678912345678912345678" // Note the exact case of "x-bp-token"
}
```
3. Confirm your subscription status by logging in to your [OneSource Dashboard](../account-access.mdx) to verify your API key is active and hasn't expired.
4. Test your API key with a [playground](../getting-started/playgrounds/README.md) to determine if the issue is with your query or the API itself.
## Query Error
### `Cannot query field X on type Y`
This error occurs when your query references fields that don't exist in our schema. To resolve:
1. Check field spelling to ensure field names match exactly what's in our schema.
2. Review schema changes in the [GraphQL Schema](https://docs.onesource.io/onesource-web3-api-reference/).
3. Use [Apollo Sandbox](../getting-started/playgrounds/apollo.mdx) to help build valid queries.
## Rate Limiting
### `Rate limit exceeded`
If you hit rate limits:
1. **Implement caching** - if you’re making the same requests over and over, caching the results can cut down on requests.
2. **Optimize queries** - only ask for the data you actually need with smaller, focused queries.
3. **Upgrade your plan** - if you consistently hit limits, you may need to move to a [higher-tier plan](../getting-started/subscription-plans.md) that offers higher limits.
## Still Need Help?
If none of the above helps, contact support at [support@onesource.io](mailto:support@onesource.io) with:
- The full request you're making.
- Any error messages you're receiving.
---
## Working With API Responses
## Structure of the Response
This is an example response you might get when executing a `token` query.
```json
{
"data": {
"token": {
"name": "Singular Focus",
"description": "The Partition is formed End Chapter 1 These former husks / Vessels adorned with ancestry / Carry the code / Of shared memory // Though flayed and quartered / The bone is porous / Fertile grounds / Ripe for the return // New flesh grows / Once we learn how to die / Souls for the bankless / The tree decides // Power sown in urns and ashes / Eternity learned / in collective demise.",
"image": {
"thumbnails": [
{
"url": "/nftindexer/thumbnail/1/42141102/medium"
}
]
},
"contract": {
"id": "0xc9041f80dce73721a5f6a779672ec57ef255d27c",
"isERC721": true,
"isERC1155": false
}
}
}
}
```
### Response Structure
Here's the general response structure for the above `token` query response.
```json
{
"data": {
"token": {
"name": "String",
"description": "String",
"image": {
"thumbnails": [
{
"url": "String"
}
]
},
"contract": {
"id": "String",
"isERC721": Boolean,
"isERC1155": Boolean
}
}
}
}
```
### Response Object Definitions
* **data**: The root object containing the response data.
* **token**: The object representing the token details.
* **name**: The name of the token.
* **description**: A description of the token.
* **image**: An object containing media details.
* **thumbnails**: A list of thumbnail objects.
* **url**: The URL of the thumbnail image.
* **contract**: An object representing the contract details.
* **id**: The contract address.
* **isERC721**: Whether the contract is ERC-721 compliant.
* **isERC1155**: Whether the contract is ERC-1155 compliant.
***
## Accessing the Data
The response structure is static and its response fields can be accessed in a consistent manner.
Below are some examples of how the response fields may be accessed in a project.
### JavaScript
```javascript
if (response.data && response.data.token) {
const tokenName = response.data.token.name;
const tokenDescription = response.data.token.description;
const thumbnailUrl = response.data.token.image.thumbnails[0].url;
const contractId = response.data.token.contract.id;
const isERC721 = response.data.token.contract.isERC721;
const isERC1155 = response.data.token.contract.isERC1155;
console.log("Token Name: " + tokenName);
console.log("Description: " + tokenDescription);
console.log("Thumbnail URL: " + thumbnailUrl);
console.log("Contract ID: " + contractId);
console.log("Is ERC-721: " + isERC721);
console.log("Is ERC-1155: " + isERC1155);
// Example: Determine token type
if (isERC721) {
console.log("This is an ERC-721 token.");
} else if (isERC1155) {
console.log("This is an ERC-1155 token.");
} else {
console.log("This token does not match ERC-721 or ERC-1155 standards.");
}
} else {
console.error("Invalid response structure");
}
```
### Python
```python
if "data" in response and "token" in response["data"]:
token_name = response["data"]["token"]["name"]
token_description = response["data"]["token"]["description"]
thumbnail_url = response["data"]["token"]["image"]["thumbnails"][0]["url"]
contract_id = response["data"]["token"]["contract"]["id"]
is_erc721 = response["data"]["token"]["contract"]["isERC721"]
is_erc1155 = response["data"]["token"]["contract"]["isERC1155"]
print("Token Name: " + token_name)
print("Description: " + token_description)
print("Thumbnail URL: " + thumbnail_url)
print("Contract ID: " + contract_id)
print("Is ERC-721: " + str(is_erc721))
print("Is ERC-1155: " + str(is_erc1155))
# Example: Determine token type
if is_erc721:
print("This is an ERC-721 token.")
elif is_erc1155:
print("This is an ERC-1155 token.")
else:
print("This token does not match ERC-721 or ERC-1155 standards.")
else:
print("Invalid response structure")
```
## Ordering
OneSource databases are built with PostgreSQL which does not have default ordering.
The only way to ensure consistent ordering of results within responses is to use the sorting arguments `orderBy` and/or `orderDirection`.
### Example
```graphql
query GetWalletBalances {
balances(
owner: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
first: 20
orderBy: VALUE
orderDirection: DESC
) {
balances {
value
contract {
name
type
id
}
}
count
}
}
```
## Pagination
When querying large datasets, it is best to paginate through results to avoid requesting the entire dataset in a single response.
Refer to the GraphQL [documentation on pagination](https://graphql.org/learn/pagination/) for a complete overview of GraphQL pagination.
OneSource supports simple cursor-based pagination using three arguments:
| Argument | Type | Description |
| -------- | -------- | -------------------------------------------------------------------------------------------------- |
| `first` | `Int` | Limits the number of items returned (i.e., `first: 10` fetches the first 10 items). |
| `after` | `String` | Specifies the `cursor` after which to start fetching items (i.e., `after: "4"`). |
| `skip` | `Int` |(Optional) Skips a specified number of items after the `cursor` (useful for offsets within a page). |
:::tip
Use ordering in conjunction with pagination when querying large datasets in order to ensure the entire dataset is retrieved.
:::
### Example
```graphql
query Tokens {
tokens(first: 50, orderBy: NAME, after: "50") {
tokens {
contract {
name
id
}
metadataContent
tokenID
}
count
cursor
}
}
```
#### JavaScript
```javascript
const PAGE_SIZE = 50;
let after = null;
let allTokens = [];
let totalCount = 0;
while (true) {
const query = `
query Tokens($after: String) {
tokens(first: ${PAGE_SIZE}, orderBy: NAME, after: $after) {
tokens {
contract {
name
id
}
metadataContent
tokenID
}
count
cursor
}
}
`;
const response = await fetch("https://api.onesource.io/federation/ethereum/graphql", {
method: "POST",
headers: {
"x-bp-token": ONESOURCE_APIKEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
query,
variables: { after }
}),
}).then((r) => r.json());
const { tokens, cursor, count } = response.data?.tokens || {};
if (!tokens || tokens.length === 0) break;
allTokens.push(...tokens);
totalCount = count;
if (!cursor || tokens.length < PAGE_SIZE) break;
after = cursor;
}
console.log(`Fetched ${allTokens.length} tokens (total count: ${totalCount})`);
```
#### Python
```python
import requests
import json
PAGE_SIZE = 50
after = None
all_tokens = []
while True:
query = """
query Tokens($after: String) {
tokens(first: %s, orderBy: NAME, after: $after) {
tokens { contract { name id } metadataContent tokenID }
cursor
}
}
""" % PAGE_SIZE
response = requests.post(
"https://api.onesource.io/federation/ethereum/graphql",
headers={"x-bp-token": "ONESOURCE_APIKEY", "Content-Type": "application/json"},
json={"query": query, "variables": {"after": after}}
).json()
tokens = response.get("data", {}).get("tokens", {})
batch = tokens.get("tokens", [])
cursor = tokens.get("cursor")
all_tokens.extend(batch)
if not cursor or len(batch) < PAGE_SIZE: break
after = cursor
print(f"Total tokens fetched:", len(all_tokens))
```
### Best Practices
* Choose a sensible `first` value (50–100) to balance response size vs. response time.
* Always check for an empty or smaller-than‑page response to know when you've reached the end.
## Handling Errors
Since the response is dynamic, developers should always check for errors and validate the structure of the response before accessing data.
### JavaScript
```javascript
if (response.errors) {
console.error("Error: " + response.errors[0].message);
} else if (response.data && response.data.token) {
const isERC721 = response.data.token.contract.isERC721;
const isERC1155 = response.data.token.contract.isERC1155;
if (isERC721) {
console.log("This is an ERC-721 token.");
} else if (isERC1155) {
console.log("This is an ERC-1155 token.");
} else {
console.log("This token does not match ERC-721 or ERC-1155 standards.");
}
} else {
console.error("Invalid response structure");
}
```
### Python
```python
if "errors" in response:
print("Error: " + response["errors"][0]["message"])
elif "data" in response and "token" in response["data"]:
is_erc721 = response["data"]["token"]["contract"]["isERC721"]
is_erc1155 = response["data"]["token"]["contract"]["isERC1155"]
if is_erc721:
print("This is an ERC-721 token.")
elif is_erc1155:
print("This is an ERC-1155 token.")
else:
print("This token does not match ERC-721 or ERC-1155 standards.")
else:
print("Invalid response structure")
```
## Common Use Cases
### Displaying Token Information
#### JavaScript
```javascript
function displayTokenInfo(response) {
if (response.data && response.data.token) {
const tokenName = response.data.token.name;
const tokenDescription = response.data.token.description;
const thumbnailUrl = response.data.token.image.thumbnails[0].url;
const isERC721 = response.data.token.contract.isERC721;
const isERC1155 = response.data.token.contract.isERC1155;
document.getElementById("token-name").innerText = tokenName;
document.getElementById("token-description").innerText = tokenDescription;
document.getElementById("token-image").src = thumbnailUrl;
if (isERC721) {
document.getElementById("token-type").innerText = "ERC-721";
} else if (isERC1155) {
document.getElementById("token-type").innerText = "ERC-1155";
} else {
document.getElementById("token-type").innerText = "Unknown Token Type";
}
} else {
console.error("Invalid response structure");
}
}
```
### Filtering Tokens by Contract Type
#### Python
```python
def filter_tokens(response):
if "data" in response and "tokens" in response["data"]:
tokens = response["data"]["tokens"]
erc721_tokens = [token for token in tokens if token["contract"]["isERC721"]]
erc1155_tokens = [token for token in tokens if token["contract"]["isERC1155"]]
print("ERC-721 Tokens: " + str(erc721_tokens))
print("ERC-1155 Tokens: " + str(erc1155_tokens))
else:
print("Invalid response structure")
```
## Best Practices
* **Validate the Response Structure**: Always check if the expected fields (including `isERC721` and `isERC1155`) exist before accessing them.
* **Handle Missing Fields Gracefully**: Use optional chaining (JavaScript) or `.get()` (Python) to avoid runtime errors.
* **Cache Responses**: Cache frequently accessed data to reduce API calls and improve performance.
* **Use TypeScript or Type Annotations**: If possible, use TypeScript (JavaScript) or type annotations (Python) to ensure type safety when working with the response.
---
## Overview
OneSource is a robust backend platform designed to empower Web3 applications with seamless, scalable, and high-performance data infrastructure. Whether you're building decentralized applications (dApps) or integrating on-chain data, OneSource ensures your projects are fast, reliable, and ready to scale as your user base grows.
***
## Key Features
### **GraphQL**
OneSource leverages GraphQL to give you precise control over the data you retrieve. Access exactly what you need, where you need it, for faster development and iteration.
### **High-Performance**
Our low-latency API ensures that your applications remain fast and responsive, even under heavy traffic. Retrieve data instantly and keep your users engaged.
### **Scalability**
As your user base grows, OneSource scales effortlessly to meet demand. Our infrastructure is designed to handle high traffic volumes without compromising performance.
### **Reliability & Uptime**
With 99.9% uptime, OneSource ensures that your operations run smoothly with minimal interruptions. Depend on us for consistent and reliable data access.
### **Media Caching**
Our cached NFT media ensures fast loading times and a great user experience for NFT-based applications.
***
## What You Can Do with OneSource
OneSource provides a comprehensive suite of query types to help you build and scale your Web3 applications:
* **Assets**: Retrieve detailed information about individual tokens and contracts, including ownership and distribution data.
* **Balances**: Gain insights into the distribution and ownership of digital assets across wallets.
* **Media**: Access token media details such as URIs, dimensions, and file types, with support for cached thumbnails in a variety of sizes.
* **Metadata**: Query metadata for tokens and contracts, including attributes, traits, creator details, and more with support for dynamic updates.
* **Blocks**: Access and filter through comprehensive real-time block data.
* **Transactions**: Obtain complete transaction details for any number of transactions.
***
## Get Started
Ready to dive in? Check out [Getting Started](getting-started/README.md) to learn how to use OneSource and integrate it into your application. For detailed information about our API, explore the [OneSource Web3 API Reference](onesource-web3-api-reference/README.md).
---
## OneSource Web3 API Reference
## GraphQL Endpoints
The OneSource Web3 API receives requests at the following endpoint URLs:
* **Avalanche C-Chain**: [https://api.onesource.io/federation/avax/graphql](https://api.onesource.io/federation/avax/graphql)
* **Base**: [https://api.onesource.io/federation/base/graphql](https://api.onesource.io/federation/base/graphql)
* **Ethereum Mainnet**: [https://api.onesource.io/federation/ethereum/graphql](https://api.onesource.io/federation/ethereum/graphql)
* **Optimism**: [https://api.onesource.io/federation/optimism/graphql](https://api.onesource.io/federation/optimism/graphql)
* **Sepolia Testnet**: [https://api.onesource.io/federation/sepolia/graphql](https://api.onesource.io/federation/sepolia/graphql)
* **Shape**: [https://api.onesource.io/federation/shape/graphql](https://api.onesource.io/federation/shape/graphql)
## Using the API Reference
When using the API Reference, it may be helpful to refer to the [GraphQL documentation](https://graphql.org/learn/) for information on GraphQL terms and concepts.
Defined below are terms as they relate to this API Reference.
### Queries
The root `Type` that is the entry point for all read operations.
| Term | Description |
|--------------|-----------------------------------------------------------------------------|
| **Arguments** | Customizes `Query` behavior. |
| **Return Type** | Usually an `Object`, what constitutes a response to a `Query`. |
### Types
`Types` define the shape and structure of the data received in response to a `Query`.
| Term | Description |
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| **Fields** | A unit of data that can be requested from a `Type`. |
| **Member Of** | The schema components of which this `Type` is a constituent. |
| **Returned By** | The `Types` that return this `Type` as a response. |
| **Values** | Predefined, named constants that represent the only valid options for a `Field` or `Argument`. |
---
## balance
import ManualContent from '../../schema/operations/queries/balance.mdx'
## Common Use Cases
- Display wallet portfolio balances for ERC-20, ERC-721, or ERC-1155 tokens.
- Verify ownership of specific NFTs by checking the balance for a contract/tokenId/account combination.
- Build token tracking dashboards showing current holdings across multiple contracts.
- Validate asset ownership before executing transfers or marketplace operations.
- Check balance changes after transactions to confirm successful transfers.
## Example
### Query
#### Check ERC-1155 Balance for an Account
```graphql
query Balance($contract: String!, $account: String!, $tokenId: UInt256) {
balance(contract: $contract, account: $account, tokenId: $tokenId) {
value
}
}
```
### Variables
```json
{ "contract": "0x76be3b62873462d2142405439777e971754e8e77",
"account": "0x11117fa34c8f660b9b804b85ebe891d0c05bf9c9",
"tokenId": 10789
}
```
### Response
```json
{
"data": {
"balance": {
"value": "689"
}
}
}
```
## Implementation Notes
:::note
- The `tokenId` parameter is optional. Omit it when querying ERC-20 token balances.
- For ERC-721 and ERC-1155 tokens, include the `tokenId` to query specific NFT ownership.
- The `value` field returns the balance in the token's smallest unit. For ERC-20 tokens with decimals, convert for display: `value / 10^decimals`.
- For ERC-721 tokens, the `value` will typically be `1` (owned) or `null` (not owned).
- For ERC-1155 tokens, the `value` represents the quantity of that specific token ID held by the account.
- If the balance query returns `null`, it means the account does not hold any balance for the specified contract/tokenId combination.
:::
---
## balances
import ManualContent from '../../schema/operations/queries/balances.mdx'
## Common Use Cases
- Build wallet dashboards showing all ERC-20, ERC-721, and ERC-1155 holdings in one view.
- Create portfolio value calculators by fetching all balances and enriching with price data.
- Monitor NFT collections by combining `ContractFilter` parameters with `TokenFilter` parameters.
- Analyze token distribution and whale wallets by ordering balances by value (`orderBy: VALUE`) with descending order.
- Track token ownership and holdings for specific smart contracts by filtering on the `address` field in `ContractFilter`.
## Example
### Query
#### Display Complete Wallet Portfolio
```graphql
query WalletPortfolio($account: String!, $first: Int!, $skip: Int!) {
balances(
first: $first
skip: $skip
where: { account: $account }
orderBy: VALUE
orderDirection: DESC
) {
numEntries
cursor
entries {
type
account
value
contract {
address
name
symbol
}
token {
tokenId
name
metadata {
name
description
image
}
}
}
}
}
```
### Variables
```json
{
"account": "0x2fc61ca1cf50983b7533653d95ace66e71759398",
"first": 10,
"skip": 0
}
```
### Response
## Implementation Notes
:::note
- The default `first` value is 10 transactions. OneSource enforces a maximum `first` value of 100. Adjust based on your UI needs.
- Use `skip` for offset-based pagination. To get the next page, use a `skip` value equal to the previous `first` value.
- Use orderBy and orderDirection to ensure consistent ordering when paginating through large result sets.
- The `token` field in returned `Balance` objects will be `null` for ERC-20 balances and populated for NFTs (ERC-721/ERC-1155).
- For ERC-20 tokens, the `value` field is in the token's smallest unit (e.g., wei for 18-decimal tokens). Convert to human-readable amounts: `value / 10^decimals`.
- For ERC-721 tokens, the `value` will typically be `1` (owned) or `null` (not owned).
- For ERC-1155 tokens, the `value` represents the quantity of that specific token ID held by the account.
- Use nested filtering via `ContractFilter` and `TokenFilter` for more specific queries (e.g., filtering by contract type or token attributes).
:::
---
## blockCount
import ManualContent from '../../schema/operations/queries/block-count.mdx'
## Common Use Cases
- Calculate total blocks produced within a specific time range for network analytics.
- Display blockchain growth metrics and statistics in dashboard applications.
- Monitor network activity by tracking block production rates over time.
- Generate historical reports on block production and network usage patterns.
- Validate data availability for specific block ranges before performing detailed queries.
## Example
### Query
#### Count Blocks Produced in the Last 7 Days
```graphql
query CountRecentBlocks($timestampGte: UInt64!) {
blockCount(where: { timestampGte: $timestampGte })
}
```
### Variables
```json
{
"timestampGte": "1730467200"
}
```
### Response
```json
{
"data": {
"blockCount": 10234
}
}
```
## Implementation Notes
:::note
- The `blockCount` query is significantly more efficient than retrieving full block data when you only need the count.
- All range filters use `Gte` (greater than or equal to) and `Lte` (less than or equal to) suffixes for inclusive ranges.
- Values for `timestamp` fields in `BlockFilter` are Unix timestamps in seconds.
- The returned count is a `UInt64` value represented as a string to ensure precision in JavaScript environments.
- Use `blockCount` in combination with the `blocks` query to calculate total pages for pagination.
- Filters can be combined to create complex queries (e.g., blocks within a time range with specific gas usage thresholds).
:::
---
## block
import ManualContent from '../../schema/operations/queries/block.mdx'
## Common Use Cases
- Display detailed block information in block explorer applications.
- Verify that a specific transaction was included in a block and retrieve its confirmation count for payment validation.
- Analyze gas usage patterns across blocks to help users optimize their transaction timing and gas price strategies.
- Monitor blocks for specific criteria such as high gas usage, large transaction volumes, or particular transaction patterns.
## Example
### Query
#### Identify Wrapped Ether (WETH) Transactions in a Specific Block
```graphql
query WrappedEtherBlockTransactions($number: UInt64, $first: Int, $where: TransactionFilter) {
block(number: $number) {
transactionCount
size
gasUsed
gasLimit
confirmations
transactions(first: $first, where: $where) {
entries {
from
to
gasPrice
gas
}
}
}
}
```
### Variables
```json
{
"number": 22530116,
"first": 5,
"where": {
"to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
}
}
```
### Response
```json
{
"data": {
"block": {
"transactionCount": 312,
"size": 170635,
"gasUsed": 35980169,
"gasLimit": 36000000,
"confirmations": 1149727,
"transactions": {
"entries": [
{
"from": "0x32f5ae3af145dbd51f5a84b0004b7588a87c9790",
"to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"gasPrice": "1250655772",
"gas": 54244
}
]
}
}
}
}
```
## Implementation Notes
:::note
- Using `number` to query by block height is generally most efficient and the most common approach.
- Use `hash` when you have a specific block hash from a transaction receipt or block header.
- The query returns a nullable `block` object which includes a nested `transactions` field that accepts pagination arguments for paginating through the block's transactions.
- Use the `confirmations` field to assess finality. Higher confirmation counts indicate lower risk of chain reorganization.
- Values for `timestamp` are Unix timestamps in seconds. Convert to local time for user-facing applications.
:::
---
## blocks
import ManualContent from '../../schema/operations/queries/blocks.mdx'
## Common Use Cases
- Display detailed block information in block explorer applications.
- Conduct historical analysis of block data using various filters such as block number ranges, timestamps, and transaction counts.
- Monitor for unusual or significant on-chain activity such as blocks with high transaction volumes or gas usage.
- Build custom blockchain data pipelines with filtered block ranges.
## Example
### Query
#### Get 5 Most Recent Blocks
```graphql
query Get5MostRecentBlocks($first: Int, $orderBy: BlockOrderBy, $orderDirection: Ordering) {
blocks(first: $first, orderBy: $orderBy, orderDirection: $orderDirection) {
entries {
number
timestamp
size
gasLimit
gasUsed
hash
}
}
}
```
### Variables
```json
{
"first": 5,
"orderBy": "NUMBER",
"orderDirection": "DESC"
}
```
### Response
```json
{
"data": {
"blocks": {
"entries": [
{
"number": 142934353,
"timestamp": 1761467483,
"size": 17819,
"gasLimit": 40000000,
"gasUsed": 12861377,
"hash": "0x968ae3cd572c782192b122d7d579672e0237aee0d644a90b591d4f5b7f745b95"
},
{
"number": 142934352,
"timestamp": 1761467481,
"size": 12601,
"gasLimit": 40000000,
"gasUsed": 36751745,
"hash": "0x513896b1480a75493aebf1c53e65c2c247a14036a49e782a635bcc9bbe3b02fd"
},
{
"number": 142934351,
"timestamp": 1761467479,
"size": 14156,
"gasLimit": 40000000,
"gasUsed": 13804391,
"hash": "0x68ad70ff88c833981ffed861569e0671b205ec9d63d09426876536564da66048"
},
{
"number": 142934350,
"timestamp": 1761467477,
"size": 11536,
"gasLimit": 40000000,
"gasUsed": 12190918,
"hash": "0x48c9ac300357d4b0a441a0173a5271cf3512d813f0567765a249d7b457a817c6"
},
{
"number": 142934349,
"timestamp": 1761467475,
"size": 15769,
"gasLimit": 40000000,
"gasUsed": 9269063,
"hash": "0x79a4c9f0f7d0fa7df0788918e656ada4b7938d127e0a035eac72ca0fcea6d608"
}
]
}
}
}
```
## Implementation Notes
:::note
- The default `first` value is 10 transactions. OneSource enforces a maximum `first` value of 100. Adjust based on your UI needs.
- Use `skip` for offset-based pagination. To get the next page, use a `skip` value equal to the previous `first` value.
- All range filters use `Gte` (greater than or equal to) and `Lte` (less than or equal to) suffixes for inclusive ranges.
- Use orderBy and orderDirection to ensure consistent ordering when paginating through large result sets.
- For ordering use `ASC` for ascending (oldest first) and `DESC` for descending (newest first).
- Each `block` object in the returned `BlockList` array supports nested `transactions()` with its own pagination for fetching transactions within that block.
:::
---
## contract
import ManualContent from '../../schema/operations/queries/contract.mdx'
## Common Use Cases
- Display contract metadata (name, symbol, decimals) in token explorers, portfolio trackers, and trading interfaces.
- Verify smart contract details and token standard implementations (ERC-20, ERC-721, ERC-1155) for wallet integrations and dApp compatibility checks.
- Monitor contract popularity and adoption by tracking holder counts over time for market analysis and investment research.
- Analyze contract deployment history including creation timestamps and block numbers for audit trails and verification purposes.
## Example
### Query
#### Get ERC-20 Token Contract Details
```graphql
query GetTokenContract($address: String!) {
contract(address: $address) {
address
name
symbol
decimals
isERC20
isERC721
isERC1155
assetType
holders
createdAt
createdBlock
}
}
```
### Variables
```json
{
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
}
```
### Response
```json
{
"data": {
"contract": {
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"isERC20": true,
"isERC721": false,
"isERC1155": false,
"assetType": "ERC20",
"holders": 9172146,
"createdAt": "2017-11-28T00:41:21Z",
"createdBlock": 4634748
}
}
}
```
## Implementation Notes
:::note
- For ERC-20 tokens, the `decimals` field indicates how to display token amounts (e.g., USDT uses 6 decimals).
- The `assetType` field provides a quick reference to the type category of the contract (e.g., `HYBRID` for multi-standard contracts and `UNKNOWN` for contracts without verifiable standard compliance).
- The `isERC20`, `isERC721`, and `isERC1155` boolean fields indicate which token standards the contract implements.
- Contracts may implement multiple standards simultaneously (e.g., a contract could be both ERC-721 and ERC-1155 compliant).
- The `holders` field represents the total count of unique addresses holding tokens from this contract, useful for gauging contract adoption.
- Use the `tokens` field (available on the `Contract` object) to fetch paginated lists of individual tokens managed by the contract, particularly useful for NFT collections.
:::
---
## contracts
import ManualContent from '../../schema/operations/queries/contracts.mdx'
## Common Use Cases
- Display all ERC-20 tokens by filtering with `isERC20: true` to build token directories or DEX interfaces.
- Monitor newly deployed contracts by filtering with `createdAtGte` and `createdAtLte` parameters to track ecosystem growth.
- Search for specific tokens by name or symbol using `nameLike` and `symbolLike` filters for token discovery features.
- Analyze popular contracts by ordering with `orderBy: HOLDERS` to identify trending tokens and high-adoption projects.
- Track NFT collections by filtering with `isERC721: true` or `isERC1155: true` to build NFT marketplaces or galleries.
- Combine filters like `createdBlockGte`/`createdBlockLte` and `holdersGte`/`holdersLte` to create advanced analytics and reporting tools.
## Example
### Query
#### Find Popular ERC-20 Tokens Created Recently
```graphql
query FindPopularTokens(
$first: Int
$where: ContractFilter
$orderBy: ContractOrderBy
$orderDirection: Ordering
) {
contracts(
first: $first
where: $where
orderBy: $orderBy
orderDirection: $orderDirection
) {
numEntries
cursor
entries {
address
name
symbol
decimals
holders
createdAt
createdBlock
}
}
}
```
### Variables
```json
{
"first": 10,
"where": {
"isERC20": true,
"createdAtGte": "2025-11-01T00:00:00Z",
"holdersGte": 100
},
"orderBy": "HOLDERS",
"orderDirection": "DESC"
}
```
### Response
```json
{
"data": {
"contracts": {
"numEntries": 10,
"cursor": "10",
"entries": [
{
"address": "0xabc123...",
"name": "Example Token",
"symbol": "EXT",
"decimals": 18,
"holders": 1500,
"createdAt": "2025-11-05T12:34:56Z",
"createdBlock": 12345678
},
// More contract entries...
]
}
}
}
```
## Implementation Notes
:::note
- The default `first` value is 10 transactions. OneSource enforces a maximum `first` value of 100. Adjust based on your UI needs.
- Use `skip` for offset-based pagination. To get the next page, use a `skip` value equal to the previous `first` value.
- All range filters use `Gte` (greater than or equal to) and `Lte` (less than or equal to) suffixes for inclusive ranges.
- Use orderBy and orderDirection to ensure consistent ordering when paginating through large result sets.
- The `nameLike` and `symbolLike` filters support case-insensitive partial matching for flexible searches.
- The `decimals` field returned by the `ContractList` object is only relevant for ERC-20 token contracts and indicates how many decimal places the token uses (typically 18).
- The `holders` field returned by the `ContractList` object represents the total count of unique addresses holding tokens from this contract.
---
## holdersCount
import ManualContent from '../../schema/operations/queries/holders-count.mdx'
## Common Use Cases
- Display total holder metrics for ERC-20 token dashboards and analytics.
- Track NFT collection ownership distribution across unique wallets.
- Monitor holder growth over time for community engagement metrics.
- Build holder leaderboards by combining with holder balance queries.
- Analyze token concentration by comparing holder count to total supply.
## Example
### Query
#### Get Total Holders for an ERC-20 Token
```graphql
query TokenHolderCount($contract: String!) {
holdersCount(contract: $contract)
}
```
### Variables
```json
{
"contract": "0xdac17f958d2ee523a2206206994597c13d831ec7"
}
```
### Response
```json
{
"data": {
"holdersCount": 4128387
}
}
```
## Implementation Notes
:::note
- For ERC-20 tokens, omit the `tokenId` parameter to get the total count of all unique holders.
- For ERC-721 tokens, the holder count without `tokenId` returns all unique owners across the entire collection. With `tokenId`, it typically returns `1` (or `0` if burned/unminted).
- For ERC-1155 tokens, specifying `tokenId` returns the count of wallets holding that specific token ID, as multiple wallets can hold the same ERC-1155 token.
- The count includes addresses with any non-zero balance, including those who may have received but not yet transferred tokens.
- Historical holder counts are not available through this query - it returns the current state only.
- For tracking holder changes over time, combine this query with timestamp-based snapshots in your application.
:::
---
## mediaList
import ManualContent from '../../schema/operations/queries/media-list.mdx'
## Common Use Cases
- Display media galleries for NFT collections by filtering on contract address or token IDs.
- Generate optimized image displays using available thumbnail presets for faster page loads.
- Track recently added or updated media using `createdAtGte`/`createdAtLte` and `updatedAtGte`/`updatedAtLte` filters.
- Filter by media and file type using the `mediaType` and `fileType` parameters for type-specific galleries.
## Example
### Query
#### Display NFT Collection Media Gallery
```graphql
query CollectionGallery($first: Int!, $skip: Int!, $mediaType: MediaType) {
mediaList(
first: $first
skip: $skip
where: { mediaType: $mediaType }
orderBy: CREATED_AT
orderDirection: DESC
) {
numEntries
cursor
entries {
url
mediaType
fileType
thumbnails(preset: MEDIUM) {
url
width
height
}
createdAt
updatedAt
}
}
}
```
### Variables
```json
{
"first": 10,
"skip": 0,
"mediaType": "IMAGE"
}
```
### Response
```json
{
"data": {
"mediaList": {
"numEntries": 10,
"cursor": "10",
"entries": [
{
"url": "https://example.com/nft-media/1.png",
"mediaType": "IMAGE",
"fileType": "image/png",
"thumbnails": [
{
"url": "https://example.com/nft-media/thumbnails/1_medium.png",
"width": 300,
"height": 300
}
],
"createdAt": "2024-01-15T12:34:56Z",
"updatedAt": "2024-02-20T08:22:10Z"
}
// More media entries...
]
}
}
}
```
## Implementation Notes
:::note
- The default `first` value is 10 transactions. OneSource enforces a maximum `first` value of 100. Adjust based on your UI needs.
- Use `skip` for offset-based pagination. To get the next page, use a `skip` value equal to the previous `first` value.
- All range filters use `Gte` (greater than or equal to) and `Lte` (less than or equal to) suffixes for inclusive ranges.
- Use orderBy and orderDirection to ensure consistent ordering when paginating through large result sets.
- Use thumbnail presets (`SMALL`, `MEDIUM`, `LARGE`) for optimized image loading rather than full-size assets.
- The `fileType` field contains the MIME type (e.g., `image/png`, `video/mp4`) for proper rendering.
- Media URLs may point to IPFS, Arweave, or centralized storage. Implement fallback handling for reliability.
:::
---
## media
import ManualContent from '../../schema/operations/queries/media.mdx'
## Common Use Cases
- Display NFT images and media assets in wallets, marketplaces, or galleries.
- Access optimized thumbnail variants for responsive image loading and performance.
- Retrieve media file types and MIME information for proper rendering.
- Build NFT detail pages with complete media asset information.
## Example
### Query
#### Retrieve Media Asset for NFT Display
```graphql
query GetNFTMedia($contract: String!, $tokenId: UInt256!) {
media(contract: $contract, tokenId: $tokenId) {
contract
tokenId
fileType
mediaType
thumbnails {
preset
uri
width
height
}
metadata {
uri
name
image
}
createdAt
updatedAt
}
}
```
### Variables
```json
{
"contract": "0x60e4d786628fea6478f785a6d7e704777c86a7c6",
"tokenId": "12345"
}
```
### Response
```json
{
"data": {
"media": {
"contract": "0x60e4d786628fea6478f785a6d7e704777c86a7c6",
"tokenId": "12345",
"fileType": "image/png",
"mediaType": "IMAGE",
"thumbnails": [
{
"preset": "SMALL",
"uri": "https://cdn.example.com/thumbnails/small/...",
"width": 256,
"height": 256
},
{
"preset": "MEDIUM",
"uri": "https://cdn.example.com/thumbnails/medium/...",
"width": 512,
"height": 512
},
{
"preset": "LARGE",
"uri": "https://cdn.example.com/thumbnails/large/...",
"width": 1024,
"height": 1024
}
],
"metadata": {
"uri": "ipfs://QmXxxx...",
"name": "Cool NFT #12345",
"image": "ipfs://QmYyyy..."
},
"createdAt": 1704067200,
"updatedAt": 1704153600
}
}
}
```
## Implementation Notes
:::note
- Use the `thumbnails` field with appropriate `preset` values (`SMALL`, `MEDIUM`, `LARGE`) for responsive images and optimized loading.
- The `fileType` field contains the MIME type (e.g., `image/png`, `video/mp4`, `audio/mpeg`) for proper content rendering.
- The `mediaType` enum categorizes media as `IMAGE`, `VIDEO`, `AUDIO`, `ANIMATION`, `DOCUMENT` or `UNKNOWN` for conditional UI rendering.
- Values for `createdAt` and `updatedAt` are Unix timestamps in seconds. Convert to local time for user-facing applications.
- The `metadata` field provides a reference to the associated token metadata, useful for displaying NFT names and descriptions alongside media.
---
## metadataList
import ManualContent from '../../schema/operations/queries/metadata-list.mdx'
## Common Use Cases
- Analyze metadata quality and completeness for collections by examining attribute distributions and missing fields.
- Track metadata updates and changes over time using timestamp filters (`createdAtGte`/`createdAtLte` or `updatedAtGte`/`updatedAtLte`).
- Build bulk metadata analysis tools for collection management, trait rarity calculations, or metadata standardization efforts.
- Generate collection reports analyzing trait distributions, attribute completeness, and metadata patterns across large NFT sets.
- Create metadata dashboards showing recently added or updated NFTs within specific time periods.
## Example
### Query
#### Analyze Recently Updated Collection Metadata
```graphql
query AnalyzeCollectionMetadata($where: MetadataFilter, $first: Int, $orderBy: MetadataOrderBy, $orderDirection: Ordering) {
metadataList(
where: $where
first: $first
orderBy: $orderBy
orderDirection: $orderDirection
) {
numEntries
cursor
entries {
name
description
updatedAt
createdAt
tokenURI
externalUrl
attributes {
traitType
value
displayType
}
}
}
}
```
### Variables
```json
{
"where": {
"updatedAtGte": "2025-01-01T00:00:00Z",
"updatedAtLte": "2025-01-31T23:59:59Z"
},
"first": 50,
"orderBy": "UPDATED_AT",
"orderDirection": "DESC"
}
```
### Response
```json
{
"data": {
"metadataList": {
"numEntries": 50,
"cursor": 1234567890,
"entries": [
{
"name": "Bored Ape #5234",
"description": "A unique Bored Ape Yacht Club NFT",
"updatedAt": "2025-01-28T14:32:18Z",
"createdAt": "2023-05-15T10:22:45Z",
"tokenURI": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/5234",
"externalUrl": "https://boredapeyachtclub.com/#/gallery/5234",
"attributes": [
{
"traitType": "Background",
"value": "Orange",
"displayType": null
},
{
"traitType": "Fur",
"value": "Brown",
"displayType": null
},
{
"traitType": "Eyes",
"value": "Bored",
"displayType": null
}
]
}
]
}
}
}
```
## Implementation Notes
:::note
- The default `first` value is 10 transactions. OneSource enforces a maximum `first` value of 100. Adjust based on your UI needs.
- Use `skip` for offset-based pagination. To get the next page, use a `skip` value equal to the previous `first` value.
- All range filters use `Gte` (greater than or equal to) and `Lte` (less than or equal to) suffixes for inclusive ranges.
- Use orderBy and orderDirection to ensure consistent ordering when paginating through large result sets.
:::
---
## metadata
import ManualContent from '../../schema/operations/queries/metadata.mdx'
## Common Use Cases
- Display comprehensive NFT details including name, description, and visual assets for marketplace listings, galleries, and portfolio trackers.
- Access token attributes and traits to enable filtering, searching, and rarity analysis in NFT marketplaces.
- Retrieve external URLs and animation URLs to provide rich, interactive NFT experiences with additional content.
- Validate metadata completeness and structure for quality assurance in minting platforms and NFT tools.
## Example
### Query
#### Retrieve Complete NFT Metadata
```graphql
query GetNFTMetadata($contract: String!, $tokenId: UInt256!) {
metadata(contract: $contract, tokenId: $tokenId) {
contract
tokenId
name
description
image
attributes {
traitType
value
displayType
}
externalUrl
animationUrl
uri
createdAt
updatedAt
}
}
```
### Variables
```json
{
"contract": "0x76be3b62873462d2142405439777e971754e8e77",
"tokenId": "10521"
}
```
### Response
```json
{
"data": {
"metadata": {
"contract": "0x76be3b62873462d2142405439777e971754e8e77",
"tokenId": "10521",
"name": "Cool Cat #10521",
"description": "Cool Cats is a collection of 9,999 randomly generated and stylistically curated NFTs that exist on the Ethereum Blockchain.",
"image": "ipfs://QmZCbZEqpQZMqSaKYLDQQZzJGvXDqXEEk5J3VQaFqZYZBN",
"attributes": [
{
"traitType": "Body",
"value": "blue cat skin",
"displayType": null
},
{
"traitType": "Hat",
"value": "miners helmet",
"displayType": null
},
{
"traitType": "Face",
"value": "star glasses",
"displayType": null
}
],
"externalUrl": "https://www.coolcatsnft.com/",
"animationUrl": null,
"uri": "ipfs://QmZCbZEqpQZMqSaKYLDQQZzJGvXDqXEEk5J3VQaFqZYZBN",
"createdAt": 1634567890,
"updatedAt": 1634567890
}
}
}
```
## Implementation Notes
:::note
- The `image` field may contain an IPFS hash, HTTP URL, or data URI. Handle all formats appropriately in your application.
- The `Attributes` object provides trait-based properties crucial for rarity calculations and filtering. The traitType and value fields are most commonly used.
- The `raw` field contains the complete, unprocessed JSON metadata—useful when standard fields don't capture all information.
- Some fields like `animationUrl`, `youtubeUrl`, and `externalUrl` may be `null` if not present in the original metadata.
- The `uri` field shows where the metadata was originally retrieved from (typically an IPFS gateway or HTTP endpoint).
- Use `createdAt` and `updatedAt` timestamps to track metadata freshness and detect updates to token metadata.
- Not all NFT projects follow metadata standards perfectly. Be prepared to handle missing or non-standard fields.
:::
---
## token
import ManualContent from '../../schema/operations/queries/token.mdx'
## Common Use Cases
- Display NFT detail pages with complete token information, images, and metadata.
- Verify token ownership and authenticity for marketplace listings and wallets.
- Track token lifecycle events including minting and burning for historical analysis.
- Build NFT galleries and collection viewers with optimized media thumbnails.
## Example
### Query
#### Display NFT Token Details with Media
```graphql
query GetTokenDetails($contract: ID!, $tokenID: ID!) {
token(contract: $contract, tokenID: $tokenID) {
tokenID
name
metadata {
description
attributes {
traitType
value
}
externalUrl
}
media {
status
mediaType
thumbnails(where: { preset: MEDIUM }) {
url
width
height
}
}
holders
mintTransaction {
hash
blockNum
timestamp
}
contract {
id
name
symbol
type
}
}
}
```
### Variables
```json
{
"contract": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"tokenID": "1234"
}
```
### Response
```json
{
"data": {
"token": {
"tokenID": "1234",
"name": "Bored Ape #1234",
"metadata": {
"description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs.",
"attributes": [
{
"traitType": "Background",
"value": "Blue"
},
{
"traitType": "Eyes",
"value": "Bored"
}
],
"externalUrl": "https://boredapeyachtclub.com"
},
"media": [
{
"status": "COMPLETED",
"mediaType": "IMAGE",
"thumbnails": [
{
"url": "https://cdn.onesource.io/media/thumb_medium_abc123.png",
"width": 300,
"height": 300
}
]
}
],
"holders": ["0x742d35cc6634c0532925a3b844bc9e7595f0beb2"],
"mintTransaction": {
"hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890",
"blockNum": 12345678,
"timestamp": 1650000000
},
"contract": {
"id": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"name": "BoredApeYachtClub",
"symbol": "BAYC",
"type": "ERC721"
}
}
}
}
```
## Implementation Notes
:::note
- Both `contract` and `tokenID` arguments are required to uniquely identify a token.
- The `holders` field returns an array of wallet addresses. For ERC-721 tokens, this typically contains one address; for ERC-1155 tokens, it may contain multiple addresses.
- Use the nested `media.thumbnails` field with the `preset` filter to retrieve optimized images in various sizes (`SMALL`, `MEDIUM`, `LARGE`, `EXTRA_LARGE`) for responsive display.
- The `burnTransaction` field will be `null` for tokens that have not been burned. Check this field to verify if a token still exists.
- The `mintTransaction.timestamp` is a Unix timestamp in seconds. Convert to local time for user-facing applications.
:::
---
## tokens
import ManualContent from '../../schema/operations/queries/tokens.mdx'
## Common Use Cases
- Browse and display collections of NFTs by filtering on contract addresses to show all tokens within a specific collection.
- Search for tokens by name using `nameLike` to build token discovery features and marketplace search functionality.
- Track token ownership and history by examining `holders`, `mintTransaction`, and `burnTransaction` data.
- Filter tokens by their burn status to identify active vs. burned tokens, useful for supply tracking and analytics.
- Combine filters like `contract` and `tokenId` ranges to create custom collection views or rarity-based displays.
- Query tokens with specific media or metadata properties to find tokens matching certain characteristics or traits.
## Example
### Query
#### Find All Tokens in a Collection with Media
```graphql
query CollectionTokens($where: TokenFilter, $first: Int) {
tokens(where: $where, first: $first, orderBy: TOKEN_ID, orderDirection: ASC) {
numEntries
cursor
entries {
tokenId
name
contract {
name
symbol
address
}
media {
url
contentType
thumbnails(where: { preset: MEDIUM }) {
url
width
height
}
}
holders
}
}
}
```
### Variables
```json
{
"where": {
"contract": {
"address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"
},
"burned": false
},
"first": 20
}
```
### Response
```json
{
"data": {
"tokens": {
"numEntries": 20,
"cursor": "20",
"entries": [
{
"tokenId": "1",
"name": "Bored Ape #1",
"contract": {
"name": "BoredApeYachtClub",
"symbol": "BAYC",
"address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"
},
"media": [
{
"url": "ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ",
"contentType": "image/png",
"thumbnails": [
{
"url": "https://media.onesource.io/thumbnails/medium/...",
"width": 512,
"height": 512
}
]
}
],
"holders": ["0x1234567890abcdef1234567890abcdef12345678"]
}
]
}
}
}
```
## Implementation Notes
:::note
- The default `first` value is 10 transactions. OneSource enforces a maximum `first` value of 100. Adjust based on your UI needs.
- Use `skip` for offset-based pagination. To get the next page, use a `skip` value equal to the previous `first` value.
- All range filters use `Gte` (greater than or equal to) and `Lte` (less than or equal to) suffixes for inclusive ranges.
- Use orderBy and orderDirection to ensure consistent ordering when paginating through large result sets.
- The `tokenId` field uses the `UInt256` type to support the full range of possible token IDs in ERC-721 and ERC-1155 contracts.
- The `burned` filter helps distinguish between active tokens and tokens that have been permanently removed from circulation.
- The `holders` array returned by the `Token` object contains wallet addresses currently holding the token. For ERC-721 tokens, this will typically be a single address. For ERC-1155 tokens, multiple addresses may hold the same token ID.
- Use nested filtering with `ContractFilter`, `MediaFilter`, and `MetadataFiler` to create sophisticated token queries.
- The `nameLike` filter performs case-insensitive partial matching, making it ideal for search functionality.
---
## transactionCount
import ManualContent from '../../schema/operations/queries/transaction-count.mdx'
## Common Use Cases
- Track overall network usage and transaction volume over time to identify trends, peak usage periods, and network growth patterns.
- Determine transaction activity for specific addresses (`from` or `to`) to analyze wallet activity, identify active users, or flag suspicious behavior.
- Count transactions involving specific smart contracts to measure contract popularity, usage frequency, and adoption rates.
- Generate transaction volume reports for specific time periods using timestamp filters to create daily, weekly, or monthly activity summaries.
- Filter by gas price ranges or gas usage thresholds to analyze network congestion periods and user behavior during different fee environments.
## Example
### Query
#### Count USDT Transactions Since a Specific Timestamp
```graphql
query CountUSDTTransactions($where: TransactionFilter) {
transactionCount(where: $where)
}
```
### Variables
```json
{
"where": {
"to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"timestampGte": 1759813200
}
}
```
### Response
```json
{
"data": {
"transactionCount": 1306026
}
}
```
## Implementation Notes
:::note
The `where` parameter accepts a `TransactionFilter` input with multiple filter options including:
- Address filters: `from` and `to`.
- Block range: `blockNumGte` and `blockNumLte`.
- Timestamp range: `timestampGte` and `timestampLte`.
- Value range: `valueGte` and `valueLte`.
- Gas filters: `gasPriceGte`, `gasPriceLte`, `gasUsedGte` and `gasUsedLte`.
- Method name: `method` (specific contract function).
- Event presence: `hasLogs` (boolean to filter transactions with or without logs).
:::
---
## transaction
import ManualContent from '../../schema/operations/queries/transaction.mdx'
## Common Use Cases
- Monitor transaction finality and confirmation depth for payment systems, exchanges, and dApps.
- Analyze historical gas costs to optimize future transaction pricing and fee strategies.
- Build transaction explorers, wallet dashboards, or audit trails for addresses.
- Verify and debug smart contract calls, including contract deployments (when `to` is null).
## Example
### Query
#### Verify Payment Status by Transaction Hash
```graphql
query VerifyPayment($hash: String!) {
transaction(hash: $hash) {
hash
confirmations
blockNum
timestamp
to
from
value
}
}
```
### Variables
```json
{
"hash": "0x22e64f2a255bbe709a702fbc22412339e7fa876b422493b6b7e03aa5fcd3b49c"
}
```
### Response
```json
{
"data": {
"transaction": {
"hash": "0x22e64f2a255bbe709a702fbc22412339e7fa876b422493b6b7e03aa5fcd3b49c",
"confirmations": 40059,
"blockNum": 23602632,
"timestamp": 1760767487,
"to": "0x99866915b444637925058a7a9984ab32e2c0714c",
"from": "0x710312405c896cedcaef82cb9105bee07ecbeab8",
"value": "3976740000000000"
}
}
}
```
## Implementation Notes
:::note
- The `value` field returns a **wei** (1 ETH = 10^18 wei) value. Convert to ETH for display: `value / 10^18`.
- For **EIP-1559** transactions, use `gasTipCap` and `gasFeeCap`. For legacy transactions, use `gasPrice`.
- The `to` field will be `null` for contract creation transactions.
- The `confirmations` field updates dynamically as new blocks are mined.
- Values for `timestamp` are Unix timestamps in seconds. Convert to local time for user-facing applications.
:::
---
## transactions
import ManualContent from '../../schema/operations/queries/transactions.mdx'
## Common Use Cases
- Display a user's complete transaction history by filtering on the `from` or `to` address.
- Monitor large transactions by filtering with `valueGte` and `valueLte` parameters.
- Track interactions with specific smart contracts by filtering on the `to` address.
- Analyze network congestion and gas price trends by ordering transactions by gas metrics (`orderBy: GAS` or using `gasPriceGte`/`gasPriceLte` filters).
- Combine filters like `blockNumGte`/`blockNumLte` and `timestampGte`/`timestampLte` to create time-based or block-based transaction views.
## Example
### Query
#### Get 5 Most Recent USDT Transactions
```graphql
query GetRecentUSDTTransactions($where: TransactionFilter, $first: Int, $orderBy: TransactionOrderBy, $orderDirection: Ordering) {
transactions(where: $where, first: $first, orderBy: $orderBy, orderDirection: $orderDirection) {
entries {
from
hash
timestamp
blockNum
gas
gasPrice
}
}
}
```
### Variables
```json
{
"where": {
"to": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
},
"first": 5,
"orderBy": "TIMESTAMP",
"orderDirection": "DESC"
}
```
### Response
```json
{
"data": {
"transactions": {
"entries": [
{
"from": "0x80787af194c33b74a811f5e5c549316269d7ee1a",
"hash": "0x59fb9291481bc4e944928f468ffe6977396bd96cdfb0c28a1438121953c0bfdd",
"timestamp": 1760714651,
"blockNum": 23598257,
"gas": 110000,
"gasPrice": "3000000000"
},
{
"from": "0xe0ca2012c3304e41c9d6e6a0d7f62c33b74356cf",
"hash": "0x7b794f64afb33ed5bf5a6856d3407fd03f89a34b1a0bf27dfc193490e14717b0",
"timestamp": 1760714651,
"blockNum": 23598257,
"gas": 49273,
"gasPrice": "1297332589"
},
{
"from": "0x2df9b935c44057ac240634c7536511d8aa03028d",
"hash": "0x4eada9f9ff04b915ca6273a4ad92635a8fcd592ed7c0807aab7483506d9f906d",
"timestamp": 1760714651,
"blockNum": 23598257,
"gas": 84000,
"gasPrice": "1608773990"
},
{
"from": "0x8e04af7f7c76daa9ab429b1340e0327b5b835748",
"hash": "0xd50760ac010e21f902bca8e961a0de92d3df594205a52443093e6a3651312a4d",
"timestamp": 1760714651,
"blockNum": 23598257,
"gas": 250000,
"gasPrice": "1323416235"
},
{
"from": "0x5fa8139192d8bb5f6684c6d808b7665e02df4833",
"hash": "0xf3ab3a5b91b1365388ef446ecff71f1d95e8a48a0816d8572b9759ac5d5e43cd",
"timestamp": 1760714651,
"blockNum": 23598257,
"gas": 70447,
"gasPrice": "1601480988"
}
]
}
}
}
```
## Implementation Notes
:::note
- The default `first` value is 10 transactions. OneSource enforces a maximum `first` value of 100. Adjust based on your UI needs.
- Use `skip` for offset-based pagination. To get the next page, use a `skip` value equal to the previous `first` value.
- All range filters use `Gte` (greater than or equal to) and `Lte` (less than or equal to) suffixes for inclusive ranges.
- The `value` for each transaction is in **wei** (1 ETH = 10^18 wei). Convert to ETH for display: `value / 10^18`.
- Gas-related values are also in **wei**. Remember to convert for display purposes.
:::
---
## AssetType
import GeneratedContent from '../../../schema/types/enums/asset-type.mdx'
---
## BalanceOrderBy
import GeneratedContent from '../../../schema/types/enums/balance-order-by.mdx'
---
## BlockOrderBy
import GeneratedContent from '../../../schema/types/enums/block-order-by.mdx'
---
## ContractOrderBy
import GeneratedContent from '../../../schema/types/enums/contract-order-by.mdx'
---
## FileType
import GeneratedContent from '../../../schema/types/enums/file-type.mdx'
---
## MediaOrderBy
import GeneratedContent from '../../../schema/types/enums/media-order-by.mdx'
---
## MediaType
import GeneratedContent from '../../../schema/types/enums/media-type.mdx'
---
## MetadataOrderBy
import GeneratedContent from '../../../schema/types/enums/metadata-order-by.mdx'
---
## Ordering
import GeneratedContent from '../../../schema/types/enums/ordering.mdx'
---
## ThumbnailPreset
import GeneratedContent from '../../../schema/types/enums/thumbnail-preset.mdx'
---
## TokenOrderBy
import GeneratedContent from '../../../schema/types/enums/token-order-by.mdx'
---
## TransactionOrderBy
import GeneratedContent from '../../../schema/types/enums/transaction-order-by.mdx'
---
## TransactionStatus
import GeneratedContent from '../../../schema/types/enums/transaction-status.mdx'
---
## BalanceFilter
import GeneratedContent from '../../../schema/types/inputs/balance-filter.mdx'
---
## BlockFilter
import GeneratedContent from '../../../schema/types/inputs/block-filter.mdx'
---
## BlockTransactionFilter
import GeneratedContent from '../../../schema/types/inputs/block-transaction-filter.mdx'
---
## ContractFilter
import GeneratedContent from '../../../schema/types/inputs/contract-filter.mdx'
---
## ContractTokenFilter
import GeneratedContent from '../../../schema/types/inputs/contract-token-filter.mdx'
---
## MediaFilter
import GeneratedContent from '../../../schema/types/inputs/media-filter.mdx'
---
## MetadataFilter
import GeneratedContent from '../../../schema/types/inputs/metadata-filter.mdx'
---
## TokenFilter
import GeneratedContent from '../../../schema/types/inputs/token-filter.mdx'
---
## TransactionFilter
import GeneratedContent from '../../../schema/types/inputs/transaction-filter.mdx'
---
## AssetTransaction
import GeneratedContent from '../../../schema/types/objects/asset-transaction.mdx'
---
## Attribute
import GeneratedContent from '../../../schema/types/objects/attribute.mdx'
---
## BalanceList
import ManualContent from '../../../schema/types/objects/balance-list.mdx'
---
## Balance(Objects)
import ManualContent from '../../../schema/types/objects/balance.mdx'
---
## BlockList
import GeneratedContent from '../../../schema/types/objects/block-list.mdx'
---
## BlockTransactionList
import GeneratedContent from '../../../schema/types/objects/block-transaction-list.mdx'
---
## BlockTransaction
import GeneratedContent from '../../../schema/types/objects/block-transaction.mdx'
---
## Block(Objects)
import GeneratedContent from '../../../schema/types/objects/block.mdx'
---
## ContractList
import ManualContent from '../../../schema/types/objects/contract-list.mdx'
---
## ContractTokenList
import GeneratedContent from '../../../schema/types/objects/contract-token-list.mdx'
---
## ContractToken
import GeneratedContent from '../../../schema/types/objects/contract-token.mdx'
---
## Contract(Objects)
import ManualContent from '../../../schema/types/objects/contract.mdx'
---
## HoldersList
import ManualContent from '../../../schema/types/objects/holders-list.mdx'
---
## MediaList(Objects)
import GeneratedContent from '../../../schema/types/objects/media-list.mdx'
---
## MediaThumbnail
import ManualContent from '../../../schema/types/objects/media-thumbnail.mdx'
---
## Media(Objects)
import ManualContent from '../../../schema/types/objects/media.mdx'
---
## MetadataList(Objects)
import GeneratedContent from '../../../schema/types/objects/metadata-list.mdx'
---
## MetadataReference
import GeneratedContent from '../../../schema/types/objects/metadata-reference.mdx'
---
## Metadata(Objects)
import GeneratedContent from '../../../schema/types/objects/metadata.mdx'
---
## TokenList
import ManualContent from '../../../schema/types/objects/token-list.mdx'
---
## Token(Objects)
import ManualContent from '../../../schema/types/objects/token.mdx'
---
## TransactionList
import GeneratedContent from '../../../schema/types/objects/transaction-list.mdx'
---
## TransactionStats
import GeneratedContent from '../../../schema/types/objects/transaction-stats.mdx'
---
## Transaction(Objects)
import GeneratedContent from '../../../schema/types/objects/transaction.mdx'
---
## Boolean
import ManualContent from '../../../schema/types/scalars/boolean.mdx'
## Example
```graphql
query SearchERC721Contracts{
contracts(where: { isERC721: true }) {
entries {
name
}
}
}
```
---
## Int
import ManualContent from '../../../schema/types/scalars/int.mdx'
### Example
```graphql
query GetLatestBlocks{
blocks(first: 20, orderBy: NUMBER, orderDirection: DESC) {
entries {
number
}
}
}
```
---
## JSON
import ManualContent from '../../../schema/types/scalars/json.mdx'
### Example
```graphql
query GetRawMetadata{
metadata(contract: "0x76be3b62873462d2142405439777e971754e8e77", tokenId: "10521") {
raw
# Returns complete raw JSON metadata
}
}
```
---
## String
import ManualContent from '../../../schema/types/scalars/string.mdx'
### Example
```graphql
query GetSenderAndRecipient{
transaction(hash: "0x8137130bac2f86462db8bee16d7b6ff75fecbfc282a8eaf5968518208ee8a4f3") {
to
from
}
}
```
:::tip
`String` values are always enclosed in double quotes (`"`) when passed as arguments in queries.
:::
---
## Time
import ManualContent from '../../../schema/types/scalars/time.mdx'
### Example
#### Query
```graphql
query GetContractCreationTime{
contract(address: "0xbd3531da5cf5857e7cfaa92426877b022e612cf8") {
createdAt
}
}
```
#### Response
```json
{
"data": {
"contract": {
"createdAt": "2021-07-22T12:26:01Z"
}
}
}
```
---
## UInt256
import ManualContent from '../../../schema/types/scalars/uint-256.mdx'
### Example
```graphql
query GetTransactionValue{
transaction(hash: "0x1d3e087034c3aaf93b4560f618f833f6cfa7257cb5373a475d42e71ec6fec26a") {
value
}
}
```
---
## UInt64
import ManualContent from '../../../schema/types/scalars/uint-64.mdx'
### Example
```graphql
query GetBlockCountLast7Days{
blockCount(where: { timestampLte: 1761116745 })
}
```
---
## balance(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `balance` query retrieves information about a specific token or NFT balance for a given account.
It returns a `Balance` object containing the asset type, contract details, account address, balance value, and associated token information.
## Schema Definition
```graphql
balance(
contract: String!
tokenId: UInt256
account: String!
): Balance
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `contract` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The contract address of the token. |
| `tokenId` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The specific token ID (required for ERC-721 and ERC-1155 tokens). |
| `account` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The account address holding the tokens. |
### Return Type
#### [Balance](/onesource-web3-api-reference/types/objects/balance.mdx)
---
## balances(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `balances` query retrieves a paginated list of token and NFT balances with comprehensive filtering, sorting, and pagination capabilities.
It returns a `BalanceList` object containing an array of `Balance` objects with detailed balance data including asset types, contract details, balance values, and associated token information.
## Schema Definition
```graphql
balances(
first: Int = 10
skip: Int = 0
where: BalanceFilter
orderBy: BalanceOrderBy
orderDirection: Ordering
): BalanceList!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of balances to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of balances to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`BalanceFilter`](/onesource-web3-api-reference/types/inputs/balance-filter.mdx) | Specifies subsets of balance data to be retrieved. |
| `orderBy` | [`BalanceOrderBy`](/onesource-web3-api-reference/types/enums/balance-order-by.mdx) | Sets how the list of balances is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of balances is ordered. |
### Return Type
#### [BalanceList](/onesource-web3-api-reference/types/objects/balance-list.mdx)
---
## blockCount(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `blockCount` query returns the total number of blockchain blocks that match specified filter criteria.
It returns a `UInt64` scalar value representing the count of blocks without retrieving the full block data, making it efficient for analytics, metrics dashboards, and pagination calculations.
## Schema Definition
```graphql
blockCount(
where: BlockFilter
): UInt64!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `where` | [`BlockFilter`](/onesource-web3-api-reference/types/inputs/block-filter.mdx) | Specifies subsets of block data to be retrieved |
### Return Type
#### [UInt64](/onesource-web3-api-reference/types/scalars/uint-64.mdx)
---
## block(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `block` query retrieves a single blockchain block by either its block number or block hash.
It returns a `block` object containing all block details including number, hash, confirmations, timestamp, transaction count, gas usage, difficulty, and a paginated list of transactions.
## Schema Definition
```graphql
block(
number: UInt64
hash: String
): Block
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `number` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The block number to retrieve. Provide either `number` or `hash`, not both. |
| `hash` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The block hash to retrieve. Provide either `number` or `hash`, not both. |
### Return Type
#### [Block](/onesource-web3-api-reference/types/objects/block.mdx)
---
## blocks(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `blocks` query retrieves a paginated list of blockchain blocks with comprehensive filtering and ordering capabilities.
It returns a `BlockList` object containing an array of `Block` objects that meet the specified filtering criteria.
## Schema Definition
```graphql
blocks(
first: Int = 10
skip: Int = 0
where: BlockFilter
orderBy: BlockOrderBy
orderDirection: Ordering
): BlockList!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of blocks to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of blocks to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`BlockFilter`](/onesource-web3-api-reference/types/inputs/block-filter.mdx) | Specifies subsets of block data to be retrieved. |
| `orderBy` | [`BlockOrderBy`](/onesource-web3-api-reference/types/enums/block-order-by.mdx) | Sets how the list of blocks is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of blocks is ordered. |
### Return Type
#### [BlockList](/onesource-web3-api-reference/types/objects/block-list.mdx)
---
## contract(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `contract` query retrieves information about a specific smart contract.
It returns a `Contract` object containing all contract metadata, token standard implementations, holder counts, creation details, and associated token information.
## Schema Definition
```graphql
contract(
address: String!
): Contract
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `address` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The address of the smart contract to retrieve. |
### Return Type
#### [Contract](/onesource-web3-api-reference/types/objects/contract.mdx)
---
## contracts(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `contracts` query retrieves a paginated list of smart contracts with comprehensive filtering, sorting, and pagination capabilities.
It returns a `ContractList` object containing an array of `Contract` objects containing all contract metadata, token standard implementations, holder counts, creation details, and associated token information.
## Schema Definition
```graphql
contracts(
first: Int = 10
skip: Int = 0
where: ContractFilter
orderBy: ContractOrderBy
orderDirection: Ordering
): ContractList!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of contracts to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of contracts to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) | Specifies subsets of contract data to be retrieved. |
| `orderBy` | [`ContractOrderBy`](/onesource-web3-api-reference/types/enums/contract-order-by.mdx) | Sets how the list of contracts is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of contracts is ordered. |
### Return Type
#### [ContractList](/onesource-web3-api-reference/types/objects/contract-list.mdx)
---
## holdersCount(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `holdersCount` query returns the total number of unique wallet addresses holding assets from a specific contract or holding a specific token ID from a specific contract.
It returns a `UInt64` scalar representing the aggregate count of distinct holders for the specified contract or token ID.
## Schema Definition
```graphql
holdersCount(
contract: String!
tokenId: UInt256
): UInt64!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `contract` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The contract address for which to count holders. |
| `tokenId` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | For ERC-1155 tokens, specify the token ID to count holders of a specific token. |
### Return Type
#### [UInt64](/onesource-web3-api-reference/types/scalars/uint-64.mdx)
---
## mediaList(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `mediaList` query retrieves a paginated list of NFT media assets and associated data with comprehensive filtering, sorting, and pagination capabilities.
It returns a `MediaList` object containing an array of `Media` objects containing an NFT's media assets and associated data.
## Schema Definition
```graphql
mediaList(
first: Int = 10
skip: Int = 0
where: MediaFilter
orderBy: MediaOrderBy = CREATED_AT
orderDirection: Ordering = DESC
): MediaList!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of media items to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of media items to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`MediaFilter`](/onesource-web3-api-reference/types/inputs/media-filter.mdx) | Specifies subsets of media data to be retrieved. |
| `orderBy` | [`MediaOrderBy`](/onesource-web3-api-reference/types/enums/media-order-by.mdx) | Sets how the list of media items is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of media items is ordered. |
### Return Type
#### [MediaList](/onesource-web3-api-reference/types/objects/media-list.mdx)
---
## media(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `media` query retrieves a specific NFT's media asset and associated data by its contract address and token IDs.
It returns a `Media` object containing all media metadata, file type information, thumbnails, and associated metadata references.
## Schema Definition
```graphql
media(
contract: String!
tokenId: UInt256!
): Media
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `contract` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The contract address of the NFT. |
| `tokenId` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The token ID of the NFT. |
### Return Type
#### [Media](/onesource-web3-api-reference/types/objects/media.mdx)
---
## metadataList(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `metadataList` query retrieves a paginated list of NFT metadata records with comprehensive filtering, sorting, and pagination capabilities.
It returns a `MetadataList` object containing an array of `Metadata` objects with detailed metadata information including names, descriptions, attributes, external URLs, and timing information.
## Schema Definition
```graphql
metadataList(
first: Int = 10
skip: Int = 0
where: MetadataFilter
orderBy: MetadataOrderBy
orderDirection: Ordering
): MetadataList!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of metadata records to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of metadata records to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`MetadataFilter`](/onesource-web3-api-reference/types/inputs/metadata-filter.mdx) | Specifies subsets of metadata to be retrieved. |
| `orderBy` | [`MetadataOrderBy`](/onesource-web3-api-reference/types/enums/metadata-order-by.mdx) | Sets how the list of metadata records is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of metadata records is ordered. |
### Return Type
#### [MetadataList](/onesource-web3-api-reference/types/objects/metadata-list.mdx)
---
## metadata(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `metadata` query retrieves detailed metadata for a specific NFT by its contract address and token ID.
It returns a `Metadata` object containing the token's name, description, attributes, image URLs, external links, and complete raw metadata.
## Schema Definition
```graphql
metadata(
contract: String!
tokenId: UInt256!
): Metadata
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `contract` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The contract address of the NFT. |
| `tokenId` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The token ID of the NFT. |
### Return Type
#### [Metadata](/onesource-web3-api-reference/types/objects/metadata.mdx)
---
## token(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `token` query retrieves detailed information about a specific NFT by its contract address and token ID.
It returns a `Token` object containing all token metadata, media assets, ownership information, and lifecycle events including mint and burn transactions.
## Schema Definition
```graphql
token(
contract: String!
tokenId: UInt256!
): Token
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `contract` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The contract address of the NFT collection. |
| `tokenId` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The unique token ID within the collection. |
### Return Type
#### [Token](/onesource-web3-api-reference/types/objects/token.mdx)
---
## tokens(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `tokens` query retrieves a paginated list of NFTs with comprehensive filtering, sorting, and pagination capabilities.
It returns a `TokenList` object containing an array of `Token` objects with detailed token data including contract information, token IDs, names, mint and burn transactions, associated media, metadata, and current holder information.
## Schema Definition
```graphql
tokens(
first: Int = 10
skip: Int = 0
where: TokenFilter
orderBy: TokenOrderBy
orderDirection: Ordering
): TokenList!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of tokens to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of tokens to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx) | Specifies subsets of token data to be retrieved. |
| `orderBy` | [`TokenOrderBy`](/onesource-web3-api-reference/types/enums/token-order-by.mdx) | Sets how the list of tokens is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of tokens is ordered. |
### Return Type
#### [TokenList](/onesource-web3-api-reference/types/objects/token-list.mdx)
---
## transactionCount(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `transactionCount` query returns the total number of blockchain transactions that match specified filter criteria.
## Schema Definition
```graphql
transactionCount(
where: TransactionFilter
): UInt64!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `where` | [`TransactionFilter`](/onesource-web3-api-reference/types/inputs/transaction-filter.mdx) | Specifies subsets of transaction data to be retrieved. |
### Return Type
#### [UInt64](/onesource-web3-api-reference/types/scalars/uint-64.mdx)
---
## transaction(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `transaction` query retrieves information about a specific blockchain transaction by its hash.
It returns a `Transaction` object containing all transaction metadata, gas fees, sender/receiver information, and associated block data.
## Schema Definition
```graphql
transaction(
hash: String!
): Transaction
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `hash` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The transaction hash to retrieve. |
### Return Type
#### [Transaction](/onesource-web3-api-reference/types/objects/transaction.mdx)
---
## transactions(Queries)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `transactions` query retrieves a paginated list of blockchain transactions with comprehensive filtering, sorting, and pagination capabilities.
It returns a `TransactionList` object containing an array of `Transaction` objects with detailed transaction data including transaction hashes, block information, gas metrics, sender and recipient addresses, transaction values, and timing information.
## Schema Definition
```graphql
transactions(
first: Int = 10
skip: Int = 0
where: TransactionFilter
orderBy: TransactionOrderBy
orderDirection: Ordering
): TransactionList!
```
### Arguments
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of transactions to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of transactions to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`TransactionFilter`](/onesource-web3-api-reference/types/inputs/transaction-filter.mdx) | Specifies subsets of transaction data to be retrieved. |
| `orderBy` | [`TransactionOrderBy`](/onesource-web3-api-reference/types/enums/transaction-order-by.mdx) | Sets how the list of transactions is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of transactions is ordered. |
### Return Type
#### [TransactionList](/onesource-web3-api-reference/types/objects/transaction-list.mdx)
---
## Schema Browser
This content is automatically generated from the OneSource Web3 API GraphQL schema. Here you can browse the schema and its queries and types.
---
## AssetType(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `AssetType` enum defines the available fields for sorting by token standard compliance category.
## Schema Definition
```graphql
enum AssetType {
ERC1155
ERC721
ERC20
HYBRID
UNKNOWN
}
```
### Values
| Value | Description |
| ----- | ----------- |
| [`ERC1155`](https://ethereum.org/developers/docs/standards/tokens/erc-1155/) | Multi-token standard supporting both fungible and non-fungible tokens in a single contract. Commonly used for gaming assets, collectible sets, and hybrid token economies. |
| [`ERC721`](https://ethereum.org/developers/docs/standards/tokens/erc-721/) | Non-fungible token (NFT) standard where each token is unique and individually identifiable. Used for digital art, collectibles, and unique digital assets. |
| [`ERC20`](https://ethereum.org/developers/docs/standards/tokens/erc-20/) | Fungible token standard where all tokens are identical and interchangeable. Used for cryptocurrencies, utility tokens, and governance tokens. |
| `HYBRID` | Contracts implementing multiple token standards simultaneously. Indicates a contract that supports combinations of ERC-20, ERC-721, and/or ERC-1155 interfaces. |
| `UNKNOWN` | Asset type could not be determined or does not conform to standard token interfaces. May indicate custom implementations or contracts that haven't been fully indexed. |
### Member Of
[`Balance`](/onesource-web3-api-reference/types/objects/balance.mdx) [`Contract`](/onesource-web3-api-reference/types/objects/contract.mdx) [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx)
---
## BalanceOrderBy(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BalanceOrderBy` enum defines the available fields for sorting balance queries.
## Schema Definition
```graphql
enum BalanceOrderBy {
TYPE
CONTRACT
TOKEN_ID
ACCOUNT
CONTRACT_TOKEN_ID
CONTRACT_ACCOUNT
CONTRACT_TOKEN_ID_ACCOUNT
VALUE
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `TYPE` | Sort balances by [`AssetType`](/onesource-web3-api-reference/types/enums/asset-type.mdx). |
| `CONTRACT` | Sort balances by the smart contract address. |
| `TOKEN_ID` | Sort balances by the unique token identifier. |
| `ACCOUNT` | Sort balances by the account that holds the balance. |
| `CONTRACT_TOKEN_ID` | Sort balances by a composite key of contract address and token ID. |
| `CONTRACT_ACCOUNT` | Sort balances by a composite key of contract address and account address. |
| `CONTRACT_TOKEN_ID_ACCOUNT` | Sort balances by a composite key of contract address, token ID, and account address. |
| `VALUE` | Sort balances by the numeric value/amount of the balance. |
### Member Of
[`balances`](/onesource-web3-api-reference/queries/balances.mdx)
---
## BlockOrderBy(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BlockOrderBy` enum defines the available fields for sorting `blocks` queries.
## Schema Definition
```graphql
enum BlockOrderBy {
NUMBER
TIMESTAMP
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `NUMBER` | Sort blocks by their sequential block number. |
| `TIMESTAMP` | Sort blocks by their Unix timestamp in seconds. |
### Member Of
[`blocks`](/onesource-web3-api-reference/queries/blocks.mdx)
---
## ContractOrderBy(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `ContractOrderBy` enum defines the available fields for sorting contract queries.
## Schema Definition
```graphql
enum ContractOrderBy {
ADDRESS
CREATED_AT
CREATED_BLOCK
DECIMALS
NAME
SYMBOL
HOLDERS
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `ADDRESS` | Sort contracts by their blockchain address in alphabetical order. |
| `CREATED_AT` | Sort contracts by their creation Unix timestamp in seconds. |
| `CREATED_BLOCK` | Sort contracts by the block number in which they were created. |
| `DECIMALS` | Sort contracts by the exact number of decimal places used in tokens managed by contracts meeting the ERC-20 token standard. |
| `NAME` | Sort contracts alphabetically by their name. |
| `SYMBOL` | Sort contracts alphabetically by their symbol. |
| `HOLDERS` | Sort contracts by an aggregate count of unique addresses holding its tokens. |
### Member Of
[`contracts`](/onesource-web3-api-reference/queries/contracts.mdx)
---
## FileType(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `FileType` enum defines the available MIME types for media files.
## Schema Definition
```graphql
enum FileType {
IMAGE_JPEG
IMAGE_PNG
IMAGE_GIF
IMAGE_WEBP
IMAGE_SVG
VIDEO_MP4
VIDEO_WEBM
VIDEO_AVI
VIDEO_QUICKTIME
AUDIO_MPEG
AUDIO_WAV
AUDIO_OGG
AUDIO_FLAC
DOCUMENT_PDF
UNKNOWN
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `IMAGE_JPEG` | JPEG image format, a lossy compressed image format commonly used for photographs and web graphics. |
| `IMAGE_PNG` | PNG image format, a lossless compressed image format supporting transparency, commonly used for web graphics and logos. |
| `IMAGE_GIF` | GIF image format, supporting animation and limited colors, commonly used for simple animations and graphics. |
| `IMAGE_WEBP` | WebP image format, a modern image format providing superior compression for both lossy and lossless images. |
| `IMAGE_SVG` | SVG image format, a vector graphics format based on XML that scales without quality loss. |
| `VIDEO_MP4` | MP4 video format, a widely supported container format commonly used for video streaming and distribution. |
| `VIDEO_WEBM` | WebM video format, an open media file format designed for the web, commonly used for HTML5 video. |
| `VIDEO_AVI` | AVI video format, a multimedia container format developed by Microsoft for audio and video content. |
| `VIDEO_QUICKTIME` | QuickTime video format, a multimedia container format developed by Apple for storing and playing digital media. |
| `AUDIO_MPEG` | MPEG audio format, including MP3, a lossy compressed audio format widely used for music and voice. |
| `AUDIO_WAV` | WAV audio format, an uncompressed audio format providing high quality sound reproduction. |
| `AUDIO_OGG` | OGG audio format, a free, open container format supporting various audio codecs like Vorbis. |
| `AUDIO_FLAC` | FLAC audio format, a lossless compressed audio format that preserves original audio quality. |
| `DOCUMENT_PDF` | PDF document format, a portable document format preserving layout and formatting across platforms. |
| `UNKNOWN` | File type could not be determined or is not supported by the defined format types. |
### Member Of
[`Media`](/onesource-web3-api-reference/types/objects/media.mdx) [`MediaFilter`](/onesource-web3-api-reference/types/inputs/media-filter.mdx)
---
## MediaOrderBy(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MediaOrderBy` enum defines the available fields for sorting media queries.
## Schema Definition
```graphql
enum MediaOrderBy {
CREATED_AT
UPDATED_AT
FILE_TYPE
MEDIA_TYPE
TOKEN_ID
CONTRACT
NAME
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `CREATED_AT` | Sort by creation Unix timestamp in seconds. Orders media items based on when they were first created in our system. |
| `UPDATED_AT` | Sort by last update Unix timestamp in seconds. Orders media items based on the time of their most recent update in our system. |
| `FILE_TYPE` | Sort by the `FileType` enum value of the media file (e.g., IMAGE_PNG, VIDEO_MP4). Orders media items alphabetically based on their `FileType` enum value. |
| `MEDIA_TYPE` | Sort by the `MediaType` enum value of the media file (e.g., IMAGE, VIDEO, AUDIO). Orders media items alphabetically based on their `MediaType` enum value. |
| `TOKEN_ID` | Sort by unique identifier of the token associated with the media numerically. |
| `CONTRACT` | Sort by address of the contract managing the token associated with the media alphabetically. |
| `NAME` | Sort by name of the token associated with the media alphabetically. |
### Member Of
[`mediaList`](/onesource-web3-api-reference/queries/media-list.mdx)
---
## MediaType(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MediaType` enum defines the available fields for sorting by media category.
## Schema Definition
```graphql
enum MediaType {
IMAGE
VIDEO
AUDIO
ANIMATION
DOCUMENT
UNKNOWN
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `IMAGE` | Static image files including formats like PNG, JPEG, GIF (non-animated), SVG, and WebP. |
| `VIDEO` | Video content and moving pictures in formats such as MP4, WebM, MOV, and AVI. |
| `AUDIO` | Audio files and sound recordings including MP3, WAV, OGG, and FLAC formats. |
| `ANIMATION` | Animated content including GIF animations, Lottie files, and other animated formats. |
| `DOCUMENT` | Document files such as PDF, text files, and other readable documents. |
| `UNKNOWN` | Media that cannot be classified into any of the above categories or when the media type is undetermined. |
### Member Of
[`Media`](/onesource-web3-api-reference/types/objects/media.mdx) [`MediaFilter`](/onesource-web3-api-reference/types/inputs/media-filter.mdx)
---
## MetadataOrderBy(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MetadataOrderBy` enum defines the available fields for sorting metadata queries.
## Schema Definition
```graphql
enum MetadataOrderBy {
CONTRACT
TOKEN_ID
CREATED_AT
UPDATED_AT
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `CONTRACT` | Sort by contract address alphabetically. |
| `TOKEN_ID` | Sort by token ID numerically. |
| `CREATED_AT` | Sort by creation Unix timestamp in seconds (when metadata was first ingested into our system). |
| `UPDATED_AT` | Sort by last update Unix timestamp in seconds (when metadata was last modified in our system). |
### Member Of
[`metadataList`](/onesource-web3-api-reference/queries/metadata-list.mdx)
---
## Ordering(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Ordering` enum controls the sort direction for query results across the API.
## Schema Definition
```graphql
enum Ordering {
ASC
DESC
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `ASC` | Ascending order - sorts from lowest to highest values (e.g., oldest to newest timestamps, smallest to largest numbers, A-Z alphabetically). |
| `DESC` | Descending order - sorts from highest to lowest values (e.g., newest to oldest timestamps, largest to smallest numbers, Z-A alphabetically). |
### Member Of
[`balances`](/onesource-web3-api-reference/queries/balances.mdx) [`blocks`](/onesource-web3-api-reference/queries/blocks.mdx) [`contracts`](/onesource-web3-api-reference/queries/contracts.mdx) [`mediaList`](/onesource-web3-api-reference/queries/media-list.mdx) [`metadataList`](/onesource-web3-api-reference/queries/metadata-list.mdx) [`tokens`](/onesource-web3-api-reference/queries/tokens.mdx) [`transactions`](/onesource-web3-api-reference/queries/transactions.mdx)
---
## ThumbnailPreset(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `ThumbnailPreset` enum defines predefined size presets for optimized media thumbnail loading.
## Schema Definition
```graphql
enum ThumbnailPreset {
MICRO
SMALL
MEDIUM
LARGE
XLARGE
ORIGINAL
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `MICRO` | Smallest thumbnail size, suitable for tiny icons or list item previews. |
| `SMALL` | Small thumbnail (typically ~150px), ideal for compact gallery views and list items. |
| `MEDIUM` | Medium thumbnail (typically ~300px), suitable for preview cards and grid layouts. |
| `LARGE` | Large thumbnail (typically ~600px), appropriate for detailed previews and modal displays. |
| `XLARGE` | Extra large thumbnail (typically ~1200px), used for high-resolution displays and hero images. |
| `ORIGINAL` | Original uncompressed media file, providing the highest quality at full resolution. |
### Member Of
[`MediaThumbnail`](/onesource-web3-api-reference/types/objects/media-thumbnail.mdx)
---
## TokenOrderBy(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TokenOrderBy` enum defines the available fields for sorting token queries.
## Schema Definition
```graphql
enum TokenOrderBy {
ADDRESS
TOKEN_ID
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `ADDRESS` | Sort tokens by their contract address. |
| `TOKEN_ID` | Sort tokens by their unique token identifier. |
### Member Of
[`tokens`](/onesource-web3-api-reference/queries/tokens.mdx)
---
## TransactionOrderBy(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TransactionOrderBy` enum defines the available fields for sorting transaction queries.
## Schema Definition
```graphql
enum TransactionOrderBy {
HASH
BLOCK_NUM
TIMESTAMP
GAS
VALUE
NONCE
FROM
TO
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `HASH` | Order transactions by their unique transaction hash identifier. |
| `BLOCK_NUM` | Order transactions by the block number in which they were included. |
| `TIMESTAMP` | Order transactions by the Unix timestamp in seconds when the block was mined. |
| `GAS` | Order transactions by the amount of gas used or gas limit. |
| `VALUE` | Order transactions by the amount of native currency transferred. |
| `NONCE` | Order transactions by the sender's transaction nonce. |
| `FROM` | Order transactions alphabetically by the sender's address. |
| `TO` | Order transactions alphabetically by the recipient's address. |
### Member Of
[`transactions`](/onesource-web3-api-reference/queries/transactions.mdx)
---
## TransactionStatus(Enums)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TransactionStatus` enum defines the possible statuses of a blockchain transaction.
## Schema Definition
```graphql
enum TransactionStatus {
SUCCESS
FAILED
PENDING
}
```
### Values
| Value | Description |
| ----- | ----------- |
| `SUCCESS` | The transaction has been successfully executed and confirmed on the blockchain. All state changes have been applied, and the transaction has been included in a finalized block. |
| `FAILED` | The transaction was included in a block but failed during execution. |
| `PENDING` | The transaction has been submitted to the network but has not yet been included in a confirmed block. This is a temporary state while the transaction awaits miner/validator processing. |
### Member Of
[`BlockTransactionFilter`](/onesource-web3-api-reference/types/inputs/block-transaction-filter.mdx) [`TransactionFilter`](/onesource-web3-api-reference/types/inputs/transaction-filter.mdx)
---
## BalanceFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BalanceFilter` input specifies subsets of balance data to be retrieved.
## Schema Definition
```graphql
input BalanceFilter {
account: String
contract: ContractFilter
token: TokenFilter
media: MediaFilter
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `account` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filters balances by the address holding the assets. |
| `contract` | [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) | Filters balances by contract-level criteria. |
| `token` | [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx) | Filters balances by token-specific criteria. |
| `media` | [`MediaFilter`](/onesource-web3-api-reference/types/inputs/media-filter.mdx) | Filters balances by their media properties. |
### Member Of
[`balances`](/onesource-web3-api-reference/queries/balances.mdx)
---
## BlockFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BlockFilter` input specifies subsets of block data to be retrieved.
## Schema Definition
```graphql
input BlockFilter {
numberGte: UInt64
numberLte: UInt64
timestampGte: UInt64
timestampLte: UInt64
transactionCountGte: Int
transactionCountLte: Int
sizeGte: UInt64
sizeLte: UInt64
gasUsedGte: UInt64
gasUsedLte: UInt64
gasLimitGte: UInt64
gasLimitLte: UInt64
difficultyGte: UInt256
difficultyLte: UInt256
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numberGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a block number greater than or equal to this value. |
| `numberLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a block number less than or equal to this value. |
| `timestampGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a timestamp greater than or equal to this value (Unix timestamp in seconds). |
| `timestampLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a timestamp less than or equal to this value (Unix timestamp in seconds). |
| `transactionCountGte` | [`Int`](/onesource-web3-api-reference/types/scalars/int.mdx) | Filter blocks containing a number of transactions greater than or equal to this value. |
| `transactionCountLte` | [`Int`](/onesource-web3-api-reference/types/scalars/int.mdx) | Filter blocks containing a number of transactions less than or equal to this value. |
| `sizeGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a size (in bytes) greater than or equal to this value. |
| `sizeLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a size (in bytes) less than or equal to this value. |
| `gasUsedGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with total gas used greater than or equal to this value. |
| `gasUsedLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with total gas used less than or equal to this value. |
| `gasLimitGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a gas limit greater than or equal to this value. |
| `gasLimitLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter blocks with a gas limit less than or equal to this value. |
| `difficultyGte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter blocks with mining difficulty greater than or equal to this value. |
| `difficultyLte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter blocks with mining difficulty less than or equal to this value. |
### Member Of
[`blockCount`](/onesource-web3-api-reference/queries/block-count.mdx) [`blocks`](/onesource-web3-api-reference/queries/blocks.mdx)
---
## BlockTransactionFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BlockTransactionFilter` input specifies subsets of transaction data within a block to be retrieved.
## Schema Definition
```graphql
input BlockTransactionFilter {
from: String
to: String
valueGte: UInt256
valueLte: UInt256
status: TransactionStatus
gasPriceGte: UInt256
gasPriceLte: UInt256
gasUsedGte: UInt64
gasUsedLte: UInt64
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `from` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by the sender's address. |
| `to` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by the recipient's address. |
| `valueGte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter transactions with a value (in wei) greater than or equal to this amount. |
| `valueLte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter transactions with a value (in wei) less than or equal to this amount. |
| `status` | [`TransactionStatus`](/onesource-web3-api-reference/types/enums/transaction-status) | Filter by transaction status. |
| `gasPriceGte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter transactions with a gas price (in wei) greater than or equal to this value. |
| `gasPriceLte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter transactions with a gas price (in wei) less than or equal to this value. |
| `gasUsedGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter transactions that consumed gas greater than or equal to this amount. |
| `gasUsedLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter transactions that consumed gas less than or equal to this amount. |
---
## ContractFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `ContractFilter` input specifies subsets of contract data to be retrieved.
## Schema Definition
```graphql
input ContractFilter {
address: String
assetType: AssetType
isERC20: Boolean
isERC721: Boolean
isERC1155: Boolean
createdAtGte: Time
createdAtLte: Time
createdBlockGte: UInt64
createdBlockLte: UInt64
decimals: Int
name: String
nameLike: String
symbol: String
symbolLike: String
holdersGte: UInt64
holdersLte: UInt64
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `address` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by a specific contract address. |
| `assetType` | [`AssetType`](/onesource-web3-api-reference/types/enums/asset-type.mdx) | Filter by the category of assets managed by the contract. |
| `isERC20` | [`Boolean`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Filter for contracts that meet the ERC-20 token standard. |
| `isERC721` | [`Boolean`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Filter for contracts that meet the ERC-721 token standard. |
| `isERC1155` | [`Boolean`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Filter for contracts that meet the ERC-1155 token standard. |
| `createdAtGte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter contracts created at or after this timestamp. |
| `createdAtLte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter contracts created at or before this timestamp. |
| `createdBlockGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter contracts deployed at or after this block number. |
| `createdBlockLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter contracts deployed at or before this block number. |
| `decimals` | [`Int`](/onesource-web3-api-reference/types/scalars/int.mdx) | Filter by the exact number of decimal places used in tokens managed by contracts meeting the ERC-20 token standard. |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by exact contract name match. |
| `nameLike` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by partial contract name match using pattern matching. |
| `symbol` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by exact contract symbol match. |
| `symbolLike` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by partial contract symbol match using pattern matching. |
| `holdersGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter contracts with an aggregate count of unique addresses holding its tokens greater than or equal to this value. |
| `holdersLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter contracts with an aggregate count of unique addresses holding its tokens less than or equal to this value. |
### Member Of
[`BalanceFilter`](/onesource-web3-api-reference/types/inputs/balance-filter.mdx) [`contracts`](/onesource-web3-api-reference/queries/contracts.mdx) [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx)
---
## ContractTokenFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `ContractTokenFilter` input specifies subsets of token data within a contract to be retrieved.
## Schema Definition
```graphql
input ContractTokenFilter {
tokenId: UInt256
burned: Boolean
name: String
nameLike: String
media: MediaFilter
metadata: MetadataFilter
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `tokenId` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter by a specific token ID. |
| `burned` | [`Boolean`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Filter tokens by their burned status. |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by exact token name match. |
| `nameLike` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by partial token name match using pattern matching. |
| `media` | [`MediaFilter`](/onesource-web3-api-reference/types/inputs/media-filter.mdx) | Filter tokens from this contract by their media properties. |
| `metadata` | [`MetadataFilter`](/onesource-web3-api-reference/types/inputs/metadata-filter.mdx) | Filter tokens from this contract by their metadata properties. |
---
## MediaFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MediaFilter` input specifies subsets of media data to be retrieved.
## Schema Definition
```graphql
input MediaFilter {
mediaType: MediaType
fileType: FileType
createdAtGte: Time
createdAtLte: Time
updatedAtGte: Time
updatedAtLte: Time
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `mediaType` | [`MediaType`](/onesource-web3-api-reference/types/enums/media-type.mdx) | Filter by the category of media type. |
| `fileType` | [`FileType`](/onesource-web3-api-reference/types/enums/file-type.mdx) | Filter by the MIME type of the media file. |
| `createdAtGte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for media created at or after this timestamp. |
| `createdAtLte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for media created at or before this timestamp. |
| `updatedAtGte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for media updated at or after this timestamp. |
| `updatedAtLte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for media updated at or before this timestamp. |
### Member Of
[`BalanceFilter`](/onesource-web3-api-reference/types/inputs/balance-filter.mdx) [`ContractTokenFilter`](/onesource-web3-api-reference/types/inputs/contract-token-filter.mdx) [`mediaList`](/onesource-web3-api-reference/queries/media-list.mdx) [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx)
---
## MetadataFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MetadataFilter` input specifies subsets of metadata to be retrieved.
## Schema Definition
```graphql
input MetadataFilter {
createdAtGte: Time
createdAtLte: Time
updatedAtGte: Time
updatedAtLte: Time
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `createdAtGte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for metadata created at or after this timestamp. |
| `createdAtLte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for metadata created at or before this timestamp. |
| `updatedAtGte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for metadata last updated at or after this timestamp. |
| `updatedAtLte` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | Filter for metadata last updated at or before this timestamp. |
### Member Of
[`ContractTokenFilter`](/onesource-web3-api-reference/types/inputs/contract-token-filter.mdx) [`metadataList`](/onesource-web3-api-reference/queries/metadata-list.mdx) [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx)
---
## TokenFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TokenFilter` input specifies subsets of token data to be retrieved.
## Schema Definition
```graphql
input TokenFilter {
tokenId: UInt256
burned: Boolean
name: String
nameLike: String
media: MediaFilter
metadata: MetadataFilter
contract: ContractFilter
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `tokenId` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter by a specific token ID. |
| `burned` | [`Boolean`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Filter tokens by burn status. |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by exact token name match. |
| `nameLike` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by partial token name match using pattern matching. |
| `media` | [`MediaFilter`](/onesource-web3-api-reference/types/inputs/media-filter.mdx) | Filter tokens by their media properties. |
| `metadata` | [`MetadataFilter`](/onesource-web3-api-reference/types/inputs/metadata-filter.mdx) | Filter tokens by their metadata properties. |
| `contract` | [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) | Filter tokens by their parent contract properties. |
### Member Of
[`BalanceFilter`](/onesource-web3-api-reference/types/inputs/balance-filter.mdx) [`tokens`](/onesource-web3-api-reference/queries/tokens.mdx)
---
## TransactionFilter(Inputs)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TransactionFilter` input specifies subsets of transaction data to be retrieved.
## Schema Definition
```graphql
input TransactionFilter {
from: String
to: String
blockNum: UInt64
blockNumGte: UInt64
blockNumLte: UInt64
timestampGte: UInt64
timestampLte: UInt64
valueGte: UInt256
valueLte: UInt256
status: TransactionStatus
gasPriceGte: UInt256
gasPriceLte: UInt256
gasUsedGte: UInt64
gasUsedLte: UInt64
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `from` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by the sender's address. |
| `to` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | Filter by the recipient's address. |
| `blockNum` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter by exact block number. |
| `blockNumGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter by minimum block number. |
| `blockNumLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter by maximum block number. |
| `timestampGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter by minimum Unix timestamp in seconds. |
| `timestampLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter by maximum Unix timestamp in seconds. |
| `valueGte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter by minimum transaction value in wei. |
| `valueLte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter by maximum transaction value in wei. |
| `status` | [`TransactionStatus`](/onesource-web3-api-reference/types/enums/transaction-status) | Filter by transaction execution status. |
| `gasPriceGte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter by minimum gas price in wei. |
| `gasPriceLte` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Filter by maximum gas price in wei. |
| `gasUsedGte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter by minimum gas consumed. |
| `gasUsedLte` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Filter by maximum gas consumed. |
### Member Of
[`transactionCount`](/onesource-web3-api-reference/queries/transaction-count.mdx) [`transactions`](/onesource-web3-api-reference/queries/transactions.mdx)
---
## AssetTransaction(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `AssetTransaction` object represents a blockchain transaction associated with the creation (minting) or destruction (burning) of a specific token.
It provides essential transaction metadata including the transaction hash, block information, confirmation status, and the associated smart contract.
## Schema Definition
```graphql
type AssetTransaction {
hash: String!
blockNum: UInt64!
blockTime: Time
confirmations: UInt64!
contract: Contract!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `hash` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The unique transaction identifier (transaction hash) on the blockchain. |
| `blockNum` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The block number in which this transaction was included. |
| `blockTime` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | The timestamp when the block containing this transaction was mined. This represents the actual time the transaction was confirmed on the blockchain. |
| `confirmations` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The number of blocks that have been mined after the block containing this transaction. |
| `contract` | [`Contract!`](/onesource-web3-api-reference/types/objects/contract.mdx) | An object representing the contract associated with this transaction. |
### Member Of
[`ContractToken`](/onesource-web3-api-reference/types/objects/contract-token.mdx) [`Token`](/onesource-web3-api-reference/types/objects/token.mdx)
---
## Attribute(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Attribute` object represents metadata properties for NFTs.
## Schema Definition
```graphql
type Attribute {
traitType: String
value: String
displayType: String
maxValue: Int
order: Int
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `traitType` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The category or type of attribute, used to group similar attributes across a collection. |
| `value` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The specific value of the attribute, can be text or numeric values represented as strings. |
| `displayType` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | How the attribute should be rendered in UIs. |
| `maxValue` | [`Int`](/onesource-web3-api-reference/types/scalars/int.mdx) | Maximum possible value for numeric attributes. Only relevant when `displayType` is numeric. |
| `order` | [`Int`](/onesource-web3-api-reference/types/scalars/int.mdx) | Sort order for displaying attributes. Lower numbers appear first. |
### Member Of
[`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx) [`MetadataReference`](/onesource-web3-api-reference/types/objects/metadata-reference.mdx)
---
## BalanceList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BalanceList` object represents a paginated collection of `Balance` objects representing token and NFT balances for a specific account or contract address.
## Schema Definition
```graphql
type BalanceList {
numEntries: UInt64!
cursor: UInt64
entries: [Balance!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of balance entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[Balance!]!`](/onesource-web3-api-reference/types/objects/balance.mdx) | An array of `Balance` objects representing individual token/NFT holdings. |
### Returned By
[`balances`](/onesource-web3-api-reference/queries/balances.mdx)
---
## Balance(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Balance` object represents an account's balance of a specific asset.
## Schema Definition
```graphql
type Balance {
type: AssetType!
contract: Contract!
account: String!
value: UInt256
token: Token
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `type` | [`AssetType!`](/onesource-web3-api-reference/types/enums/asset-type.mdx) | The type of asset. |
| `contract` | [`Contract!`](/onesource-web3-api-reference/types/objects/contract.mdx) | An object representing the properties of the contract that issued the asset. |
| `account` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The blockchain address that owns this balance. |
| `value` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The quantity of the asset held by the account. |
| `token` | [`Token`](/onesource-web3-api-reference/types/objects/token.mdx) | An object representing the properties of the asset. |
### Returned By
[`balance`](/onesource-web3-api-reference/queries/balance.mdx)
### Member Of
[`BalanceList`](/onesource-web3-api-reference/types/objects/balance-list.mdx)
---
## BlockList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BlockList` object represents a paginated collection of `Block` objects representing individual blockchain blocks.
## Schema Definition
```graphql
type BlockList {
numEntries: UInt64!
cursor: UInt64
entries: [Block!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of block entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[Block!]!`](/onesource-web3-api-reference/types/objects/block.mdx) | An array of `Block` objects representing individual blockchain blocks. |
### Returned By
[`blocks`](/onesource-web3-api-reference/queries/blocks.mdx)
---
## BlockTransactionList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BlockTransactionList` object represents a paginated collection of `BlockTransaction` objects representing a transaction included within a specific block.
It is returned by the `transactions` field on the `Block`object.
## Schema Definition
```graphql
type BlockTransactionList {
numEntries: UInt64!
cursor: UInt64
entries: [BlockTransaction!]!
stats: TransactionStats
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of transaction entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[BlockTransaction!]!`](/onesource-web3-api-reference/types/objects/block-transaction.mdx) | An array of `BlockTransaction` objects representing a transaction included within the block. |
| `stats` | [`TransactionStats`](/onesource-web3-api-reference/types/objects/transaction-stats.mdx) | An object representing aggregate statistics for the transactions in the list. |
### Member Of
[`Block`](/onesource-web3-api-reference/types/objects/block.mdx)
---
## BlockTransaction(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `BlockTransaction` object represents a transaction included within a specific block.
## Schema Definition
```graphql
type BlockTransaction {
hash: String!
timestamp: UInt64!
to: String
from: String
gas: UInt64!
gasPrice: UInt256
gasTipCap: UInt256
gasFeeCap: UInt256
value: UInt256
nonce: UInt64!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `hash` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The unique transaction hash used to identify this transaction on the blockchain. |
| `timestamp` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Unix timestamp (in seconds) when the transaction was first confirmed. |
| `to` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The recipient address. Returns `null` for contract creation transactions. |
| `from` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The sender address that initiated the transaction. |
| `gas` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The gas limit allocated for this transaction. |
| `gasPrice` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Legacy gas price in wei (used in pre-EIP-1559 transactions). Returns `null` for EIP-1559 transactions. |
| `gasTipCap` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Maximum priority fee per gas in wei (EIP-1559). Returns `null` for legacy transactions. |
| `gasFeeCap` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Maximum total fee per gas in wei (EIP-1559). Returns `null` for legacy transactions. |
| `value` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Amount of native currency (e.g., ETH) transferred in wei. Use `value / 10^18` to convert to ETH. |
| `nonce` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Transaction sequence number from the sender's account. |
### Member Of
[`BlockTransactionList`](/onesource-web3-api-reference/types/objects/block-transaction-list.mdx)
---
## Block(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Block` object represents a single blockchain block and contains all data pertaining to the block and its transactions.
## Schema Definition
```graphql
type Block {
number: UInt64!
hash: String!
confirmations: UInt64!
timestamp: UInt64!
transactionCount: Int!
gasUsed: UInt64!
gasLimit: UInt64!
size: UInt64!
difficulty: UInt256!
transactions(
first: Int = 10
skip: Int = 0
where: BlockTransactionFilter
orderBy: TransactionOrderBy
orderDirection: Ordering
): BlockTransactionList!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `number` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The sequential block number in the blockchain. |
| `hash` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The unique cryptographic hash identifier for this block. |
| `confirmations` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The number of blocks confirmed after this block. |
| `timestamp` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Unix timestamp of when the block was mined. |
| `transactionCount` | [`Int!`](/onesource-web3-api-reference/types/scalars/int.mdx) | Total number of transactions contained in this block. |
| `gasUsed` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Total gas consumed by all transactions in the block. |
| `gasLimit` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Maximum gas allowed for transactions in this block. |
| `size` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The block size in bytes. |
| `difficulty` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Mining difficulty level for this block. |
| `transactions` | [`BlockTransactionList!`](/onesource-web3-api-reference/types/objects/block-transaction-list.mdx) | An array of `BlockTransaction` objects representing transactions included in this block. |
### Arguments
These arguments control how transactions are retrieved when querying the `transactions` field which returns a [`BlockTransactionList`](/onesource-web3-api-reference/types/objects/block-transaction-list.mdx) object.
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of transactions to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of transactions to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`BlockTransactionFilter`](/onesource-web3-api-reference/types/inputs/block-transaction-filter.mdx) | Specifies subsets of transaction data within a block to be retrieved. |
| `orderBy` | [`TransactionOrderBy`](/onesource-web3-api-reference/types/enums/transaction-order-by.mdx) | Sets how the list of transactions is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of transactions is ordered. |
### Returned By
[`block`](/onesource-web3-api-reference/queries/block.mdx)
### Member Of
[`BlockList`](/onesource-web3-api-reference/types/objects/block-list.mdx) [`Transaction`](/onesource-web3-api-reference/types/objects/transaction.mdx)
---
## ContractList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `ContractList` object represents a paginated collection of `Contract` objects representing individual smart contracts.
## Schema Definition
```graphql
type ContractList {
numEntries: UInt64!
cursor: UInt64
entries: [Contract!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of contract entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[Contract!]!`](/onesource-web3-api-reference/types/objects/contract.mdx) | An array of `Contract` objects representing individual smart contracts. |
### Returned By
[`contracts`](/onesource-web3-api-reference/queries/contracts.mdx)
---
## ContractTokenList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `ContractTokenList` object provides a paginated list of `ContractToken` objects representing tokens associated with a specific smart contract.
It is returned by the `tokens` field on the `Contract` object.
## Schema Definition
```graphql
type ContractTokenList {
numEntries: UInt64!
cursor: UInt64
entries: [ContractToken!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of token entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[ContractToken!]!`](/onesource-web3-api-reference/types/objects/contract-token.mdx) | An array of `ContractToken` objects representing the individual tokens associated with the smart contract. |
### Member Of
[`Contract`](/onesource-web3-api-reference/types/objects/contract.mdx)
---
## ContractToken(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `ContractToken` object represents an individual token within a smart contract.
Unlike the `Token` object which includes a contract reference, `ContractToken` is specifically used when querying tokens through a contract's token collection via `Contract.tokens`.
## Schema Definition
```graphql
type ContractToken {
tokenId: UInt256!
name: String
mintTransaction: AssetTransaction
burnTransaction: AssetTransaction
media: [Media!]!
metadata: Metadata
holders: HoldersList!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `tokenId` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The unique identifier for this token within the contract. |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The display name of the NFT. |
| `mintTransaction` | [`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) | An object representing the transaction in which this token was minted. |
| `burnTransaction` | [`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) | An object representing the transaction in which this token was burned. This field is `null` if the token has not been burned. |
| `media` | [`[Media!]!`](/onesource-web3-api-reference/types/objects/media.mdx) | An array of `Media` objects representing the media assets and data associated with this token. |
| `metadata` | [`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx) | An object representing the metadata associated with this token. |
| `holders` | [`HoldersList!`](/onesource-web3-api-reference/types/objects/holders-list.mdx) | An array of wallet addresses that currently hold this token. |
### Member Of
[`ContractTokenList`](/onesource-web3-api-reference/types/objects/contract-token-list.mdx)
---
## Contract(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Contract` object represents an individual smart contract deployed on the blockchain and contains comprehensive details about the smart contract.
## Schema Definition
```graphql
type Contract {
address: String!
assetType: AssetType!
isERC20: Boolean!
isERC721: Boolean!
isERC1155: Boolean!
createdAt: Time
createdBlock: UInt64
decimals: Int
name: String
symbol: String
holders: UInt64
tokens(
first: Int = 10
skip: Int = 0
where: ContractTokenFilter
orderBy: TokenOrderBy
orderDirection: Ordering
): ContractTokenList!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `address` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The blockchain address of the deployed contract. |
| `assetType` | [`AssetType!`](/onesource-web3-api-reference/types/enums/asset-type.mdx) | The type of assets managed by this contract. |
| `isERC20` | [`Boolean!`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Indicates whether the contract implements the ERC-20 fungible token standard. |
| `isERC721` | [`Boolean!`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Indicates whether the contract implements the ERC-721 non-fungible token (NFT) standard. |
| `isERC1155` | [`Boolean!`](/onesource-web3-api-reference/types/scalars/boolean.mdx) | Indicates whether the contract implements the ERC-1155 multi-token standard. |
| `createdAt` | [`Time`](/onesource-web3-api-reference/types/scalars/time.mdx) | The timestamp when the contract was deployed to the blockchain. |
| `createdBlock` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The block number at which the contract was created/deployed. |
| `decimals` | [`Int`](/onesource-web3-api-reference/types/scalars/int.mdx) | The number of decimal places used by the token (relevant for ERC-20 tokens). |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The human-readable name of the contract. |
| `symbol` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The ticker symbol of the contract. |
| `holders` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of unique addresses that hold tokens from this contract. |
| `tokens` | [`ContractTokenList!`](/onesource-web3-api-reference/types/objects/contract-token-list.mdx) | An array of `ContractToken` objects representing tokens managed by this contract. |
### Arguments
These arguments control how tokens are retrieved when querying the `tokens` field which returns a [`ContractTokenList`](/onesource-web3-api-reference/types/objects/contract-token-list.mdx) object.
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `first` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 10 | Maximum number of tokens to retrieve per page. Maximum value is `100`. |
| `skip` | [Int](/onesource-web3-api-reference/types/scalars/int.mdx) = 0 | Number of tokens to bypass before assembling the page. Set to the `first` value from the previous page for offset pagination. |
| `where` | [`ContractTokenFilter`](/onesource-web3-api-reference/types/inputs/contract-token-filter.mdx) | Specifies subsets of token data within a contract to be retrieved. |
| `orderBy` | [`TokenOrderBy`](/onesource-web3-api-reference/types/enums/token-order-by.mdx) | Sets how the list of tokens is ordered. |
| `orderDirection` | [`Ordering`](/onesource-web3-api-reference/types/enums/ordering.mdx) | Sets the direction in which the list of tokens is ordered. |
### Returned By
[`contract`](/onesource-web3-api-reference/queries/contract.mdx)
### Member Of
[`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) [`Balance`](/onesource-web3-api-reference/types/objects/balance.mdx) [`ContractList`](/onesource-web3-api-reference/types/objects/contract-list.mdx) [`Token`](/onesource-web3-api-reference/types/objects/token.mdx)
---
## HoldersList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `HoldersList` object represents a collection of wallet addresses that hold a specific token.
## Schema Definition
```graphql
type HoldersList {
numEntries: UInt64!
entries: [String!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of holder entries in the list. |
| `entries` | [`[String!]!`](/onesource-web3-api-reference/types/scalars/string.mdx) | An array of wallet addresses representing the holders. |
### Member Of
[`ContractToken`](/onesource-web3-api-reference/types/objects/contract-token.mdx) [`Token`](/onesource-web3-api-reference/types/objects/token.mdx)
---
## MediaList(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MediaList` object represents a paginated collection of `Media` objects representing media assets and data associated with a token.
## Schema Definition
```graphql
type MediaList {
numEntries: UInt64!
cursor: String
entries: [Media!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of media entries matching the query criteria in the current page. |
| `cursor` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[Media!]!`](/onesource-web3-api-reference/types/objects/media.mdx) | An array of `Media` objects representing a token's media assets and associated data. |
### Returned By
[`mediaList`](/onesource-web3-api-reference/queries/media-list.mdx)
---
## MediaThumbnail(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MediaThumbnail` object represents a single thumbnail variant of media content.
Thumbnails are automatically generated, compressed versions of the original media at different size presets, optimized for various display contexts such as gallery views, previews, and list items. Each thumbnail maintains its own URL, format specifications, and metadata.
## Schema Definition
```graphql
type MediaThumbnail {
url: String!
preset: ThumbnailPreset!
format: String!
fileSize: UInt64
createdAt: Time!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `url` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The URL where the thumbnail can be retrieved. |
| `preset` | [`ThumbnailPreset!`](/onesource-web3-api-reference/types/enums/thumbnail-preset.mdx) | The size preset of this thumbnail variant. |
| `format` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The file format of the thumbnail. |
| `fileSize` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The size of the thumbnail file in bytes. |
| `createdAt` | [`Time!`](/onesource-web3-api-reference/types/scalars/time.mdx) | The timestamp when this thumbnail was generated and became available in the system. |
### Member Of
[`Media`](/onesource-web3-api-reference/types/objects/media.mdx)
---
## Media(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Media` object represents an NFT's media assets and associated data.
## Schema Definition
```graphql
type Media {
contract: String!
tokenId: UInt256!
fileType: FileType
mediaType: MediaType
metadata: MetadataReference
thumbnails(
preset: ThumbnailPreset
): [MediaThumbnail!]!
createdAt: Time!
updatedAt: Time!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `contract` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The address of the contract managing the token associated with this media. |
| `tokenId` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The unique identifier of the token associated with this media within its contract. |
| `fileType` | [`FileType`](/onesource-web3-api-reference/types/enums/file-type.mdx) | The MIME type of the media content (e.g., `image/png` or `video/mp4`). |
| `mediaType` | [`MediaType`](/onesource-web3-api-reference/types/enums/media-type.mdx) | The categorized type of media. |
| `metadata` | [`MetadataReference`](/onesource-web3-api-reference/types/objects/metadata-reference.mdx) | An object representing the metadata associated with the token associated with this media. |
| `thumbnails` | [`[MediaThumbnail!]!`](/onesource-web3-api-reference/types/objects/media-thumbnail.mdx) | An array of `MediaThumbnail` objects representing a generated variant of this media. |
| `createdAt` | [`Time!`](/onesource-web3-api-reference/types/scalars/time.mdx) | Timestamp of when this media record was first created. |
| `updatedAt` | [`Time!`](/onesource-web3-api-reference/types/scalars/time.mdx) | Timestamp of the last update to this media record. |
### Arguments
These arguments control how thumbnails are retrieved when querying the `thumbnails` field which returns an array of `MediaThumbnail` objects.
| Argument | Type | Description |
| -------- | ---- | ----------- |
| `preset` | [`ThumbnailPreset`](/onesource-web3-api-reference/types/enums/thumbnail-preset.mdx) | Predefined size presets for optimized media thumbnail loading. |
### Returned By
[`media`](/onesource-web3-api-reference/queries/media.mdx)
### Member Of
[`ContractToken`](/onesource-web3-api-reference/types/objects/contract-token.mdx) [`MediaList`](/onesource-web3-api-reference/types/objects/media-list.mdx) [`Token`](/onesource-web3-api-reference/types/objects/token.mdx)
---
## MetadataList(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MetadataList` object represents a paginated collection of `Metadata` objects representing the metadata associated with an NFT.
## Schema Definition
```graphql
type MetadataList {
numEntries: UInt64!
cursor: UInt64
entries: [Metadata!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of metadata entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[Metadata!]!`](/onesource-web3-api-reference/types/objects/metadata.mdx) | An array of `Metadata` objects representing a token's metadata. |
### Returned By
[`metadataList`](/onesource-web3-api-reference/queries/metadata-list.mdx)
---
## MetadataReference(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `MetadataReference` object represents the metadata associated with an NFT as a constituent of its `Media` object.
## Schema Definition
```graphql
type MetadataReference {
name: String
description: String
image: String
animationUrl: String
externalUrl: String
attributes: [Attribute]
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The name or title of the NFT. |
| `description` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | A human-readable description of the NFT. |
| `image` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | URL pointing to the original location of the NFT's primary image or other media. |
| `animationUrl` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | URL pointing to an animation, video, or interactive content for the NFT. |
| `externalUrl` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | URL pointing to an external website or resource related to the NFT. |
| `attributes` | [`[Attribute]`](/onesource-web3-api-reference/types/objects/attribute.mdx) | JSON string representation of the NFT's traits and properties. |
### Member Of
[`Media`](/onesource-web3-api-reference/types/objects/media.mdx)
---
## Metadata(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Metadata` object represents an NFT's metadata.
## Schema Definition
```graphql
type Metadata {
contract: String!
tokenId: UInt256!
uri: String
name: String
description: String
image: String
attributes: [Attribute]
externalUrl: String
animationUrl: String
youtubeUrl: String
raw: JSON
size: Int
createdAt: Time!
updatedAt: Time!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `contract` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The address of the contract managing the `tokenId` associated with this metadata. |
| `tokenId` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The unique identifier of the token associated with this metadata within its contract. |
| `uri` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The URI endpoint from where the metadata was retrieved. |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The display name of the NFT. |
| `description` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | A human-readable description of the NFT. |
| `image` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The URL or IPFS hash pointing to the original location of the token's primary image or other media. |
| `attributes` | [`[Attribute]`](/onesource-web3-api-reference/types/objects/attribute.mdx) | An array of `Attribute` objects representing the NFT's individual metadata properties. |
| `externalUrl` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | URL pointing to an external website or resource related to the NFT. |
| `animationUrl` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | URL pointing to an animation, video, or interactive content for the NFT. |
| `youtubeUrl` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | URL pointing to a YouTube video associated with the NFT. |
| `raw` | [`JSON`](/onesource-web3-api-reference/types/scalars/json.mdx) | The complete raw JSON metadata as retrieved from the token URI. |
| `size` | [`Int`](/onesource-web3-api-reference/types/scalars/int.mdx) | Size of the metadata payload in bytes. |
| `createdAt` | [`Time!`](/onesource-web3-api-reference/types/scalars/time.mdx) | Timestamp of when this metadata record was first created. |
| `updatedAt` | [`Time!`](/onesource-web3-api-reference/types/scalars/time.mdx) | Timestamp of the last update to this metadata record. |
### Returned By
[`metadata`](/onesource-web3-api-reference/queries/metadata.mdx)
### Member Of
[`ContractToken`](/onesource-web3-api-reference/types/objects/contract-token.mdx) [`MetadataList`](/onesource-web3-api-reference/types/objects/metadata-list.mdx) [`Token`](/onesource-web3-api-reference/types/objects/token.mdx)
---
## TokenList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TokenList` object represents a paginated collection of `Token` objects representing individual tokens.
## Schema Definition
```graphql
type TokenList {
numEntries: UInt64!
cursor: UInt64
entries: [Token!]!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of token entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[Token!]!`](/onesource-web3-api-reference/types/objects/token.mdx) | An array of `Token` objects representing an individual token. |
### Returned By
[`tokens`](/onesource-web3-api-reference/queries/tokens.mdx)
---
## Token(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Token` object represents an individual NFT.
## Schema Definition
```graphql
type Token {
contract: Contract!
tokenId: UInt256!
name: String
mintTransaction: AssetTransaction
burnTransaction: AssetTransaction
media: [Media!]!
metadata: Metadata
holders: HoldersList!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `contract` | [`Contract!`](/onesource-web3-api-reference/types/objects/contract.mdx) | An object representing the properties of the contract managing this NFT. |
| `tokenId` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The unique identifier of this NFT within its contract. |
| `name` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The display name of the NFT. |
| `mintTransaction` | [`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) | An object representing the transaction that created this NFT. |
| `burnTransaction` | [`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) | An object representing a transaction that destroyed this NFT. `Null` if the token has not been burned. |
| `media` | [`[Media!]!`](/onesource-web3-api-reference/types/objects/media.mdx) | An array of `Media` objects representing the media assets and associated data associated with this NFT. |
| `metadata` | [`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx) | An object representing the metadata associated with this NFT. |
| `holders` | [`HoldersList!`](/onesource-web3-api-reference/types/objects/holders-list.mdx) | An array of wallet addresses that currently hold this NFT. |
### Returned By
[`token`](/onesource-web3-api-reference/queries/token.mdx)
### Member Of
[`Balance`](/onesource-web3-api-reference/types/objects/balance.mdx) [`TokenList`](/onesource-web3-api-reference/types/objects/token-list.mdx)
---
## TransactionList(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TransactionList` object represents a paginated collection of `Transaction` objects representing individual transactions.
## Schema Definition
```graphql
type TransactionList {
numEntries: UInt64!
cursor: UInt64
entries: [Transaction!]!
stats: TransactionStats
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `numEntries` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of transaction entries matching the query criteria in the current page. |
| `cursor` | [`UInt64`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | An optional pagination cursor pointing to the next page of results. Use this value with `skip` in subsequent queries to fetch the next page. |
| `entries` | [`[Transaction!]!`](/onesource-web3-api-reference/types/objects/transaction.mdx) | An array of `Transaction` objects representing individual transactions. |
| `stats` | [`TransactionStats`](/onesource-web3-api-reference/types/objects/transaction-stats.mdx) | An object representing aggregate statistics for the transactions in the list. |
### Returned By
[`transactions`](/onesource-web3-api-reference/queries/transactions.mdx)
---
## TransactionStats(Objects)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `TransactionStats` object represents aggregate statistics for the transactions included in a `TransactionsList` object.
## Schema Definition
```graphql
type TransactionStats {
totalCount: UInt64!
totalValue: UInt256!
averageGasPrice: UInt256!
averageGasUsed: UInt64!
uniqueAddresses: UInt64!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `totalCount` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The total number of transactions included in the `TransactionsList` object. |
| `totalValue` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The cumulative value of all transactions included in the `TransactionsList` object in `wei`. |
| `averageGasPrice` | [`UInt256!`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | The average gas price across all transactions included in the `TransactionsList` object. |
| `averageGasUsed` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The average amount of gas consumed per transaction included in the `TransactionsList` object. |
| `uniqueAddresses` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The count of distinct addresses involved in the transactions included in the `TransactionsList` object. |
### Member Of
[`BlockTransactionList`](/onesource-web3-api-reference/types/objects/block-transaction-list.mdx) [`TransactionList`](/onesource-web3-api-reference/types/objects/transaction-list.mdx)
---
## Transaction(3)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Transaction` object represents an individual blockchain transaction.
## Schema Definition
```graphql
type Transaction {
hash: String!
blockNum: UInt64!
timestamp: UInt64!
confirmations: UInt64!
to: String
from: String
gas: UInt64!
gasPrice: UInt256
gasTipCap: UInt256
gasFeeCap: UInt256
value: UInt256
nonce: UInt64!
block: Block!
}
```
### Fields
| Field | Type | Description |
| ----- | ---- | ----------- |
| `hash` | [`String!`](/onesource-web3-api-reference/types/scalars/string.mdx) | The unique transaction hash used to identify this transaction on the blockchain. |
| `blockNum` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The block number in which this transaction was included. |
| `timestamp` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Unix timestamp (in seconds) when the transaction was first confirmed. |
| `confirmations` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Number of blocks confirmed after this transaction's block. |
| `to` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The recipient address. Returns `null` for contract creation transactions. |
| `from` | [`String`](/onesource-web3-api-reference/types/scalars/string.mdx) | The sender address that initiated the transaction. |
| `gas` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | The gas limit allocated for this transaction. |
| `gasPrice` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Legacy gas price in wei (used in pre-EIP-1559 transactions). Returns `null` for EIP-1559 transactions. |
| `gasTipCap` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Maximum priority fee per gas in wei (EIP-1559). Returns `null` for legacy transactions. |
| `gasFeeCap` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Maximum total fee per gas in wei (EIP-1559). Returns `null` for legacy transactions. |
| `value` | [`UInt256`](/onesource-web3-api-reference/types/scalars/uint-256.mdx) | Amount of native currency (e.g., ETH) transferred in wei. Use `value / 10^18` to convert to ETH. |
| `nonce` | [`UInt64!`](/onesource-web3-api-reference/types/scalars/uint-64.mdx) | Transaction sequence number from the sender's account. |
| `block` | [`Block!`](/onesource-web3-api-reference/types/objects/block.mdx) | An object representing the block containing this transaction. |
### Returned By
[`transaction`](/onesource-web3-api-reference/queries/transaction.mdx)
### Member Of
[`TransactionList`](/onesource-web3-api-reference/types/objects/transaction-list.mdx)
---
## Boolean(Scalars)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Boolean` scalar type represents `true` or `false`.
It is a fundamental logical type used to represent binary states, flags, and conditional properties.
## Schema Definition
```graphql
scalar Boolean
```
### Member Of
[`Contract`](/onesource-web3-api-reference/types/objects/contract.mdx) [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) [`ContractTokenFilter`](/onesource-web3-api-reference/types/inputs/contract-token-filter.mdx) [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx)
---
## Int(Scalars)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
It is a standard 32-bit signed integer used for counting, indexing, and smaller numeric values that don't exceed the integer range.
## Schema Definition
```graphql
scalar Int
```
### Member Of
[`Attribute`](/onesource-web3-api-reference/types/objects/attribute.mdx) [`balances`](/onesource-web3-api-reference/queries/balances.mdx) [`Block`](/onesource-web3-api-reference/types/objects/block.mdx) [`BlockFilter`](/onesource-web3-api-reference/types/inputs/block-filter.mdx) [`blocks`](/onesource-web3-api-reference/queries/blocks.mdx) [`Contract`](/onesource-web3-api-reference/types/objects/contract.mdx) [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) [`contracts`](/onesource-web3-api-reference/queries/contracts.mdx) [`mediaList`](/onesource-web3-api-reference/queries/media-list.mdx) [`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx) [`metadataList`](/onesource-web3-api-reference/queries/metadata-list.mdx) [`tokens`](/onesource-web3-api-reference/queries/tokens.mdx) [`transactions`](/onesource-web3-api-reference/queries/transactions.mdx)
---
## JSON(Scalars)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `JSON` scalar type represents arbitrary JSON-serializable data structures.
It is used to store complete, unprocessed NFT metadata.
## Schema Definition
```graphql
scalar JSON
```
### Member Of
[`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx)
---
## String(Scalars)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `String` scalar type represents textual data, represented as UTF-8 character sequences.
It is used to represent free-form human-readable text.
## Schema Definition
```graphql
scalar String
```
### Member Of
[`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) [`Attribute`](/onesource-web3-api-reference/types/objects/attribute.mdx) [`balance`](/onesource-web3-api-reference/queries/balance.mdx) [`Balance`](/onesource-web3-api-reference/types/objects/balance.mdx) [`BalanceFilter`](/onesource-web3-api-reference/types/inputs/balance-filter.mdx) [`block`](/onesource-web3-api-reference/queries/block.mdx) [`Block`](/onesource-web3-api-reference/types/objects/block.mdx) [`BlockTransaction`](/onesource-web3-api-reference/types/objects/block-transaction.mdx) [`BlockTransactionFilter`](/onesource-web3-api-reference/types/inputs/block-transaction-filter.mdx) [`contract`](/onesource-web3-api-reference/queries/contract.mdx) [`Contract`](/onesource-web3-api-reference/types/objects/contract.mdx) [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) [`ContractToken`](/onesource-web3-api-reference/types/objects/contract-token.mdx) [`ContractTokenFilter`](/onesource-web3-api-reference/types/inputs/contract-token-filter.mdx) [`holdersCount`](/onesource-web3-api-reference/queries/holders-count.mdx) [`HoldersList`](/onesource-web3-api-reference/types/objects/holders-list.mdx) [`media`](/onesource-web3-api-reference/queries/media.mdx) [`Media`](/onesource-web3-api-reference/types/objects/media.mdx) [`MediaList`](/onesource-web3-api-reference/types/objects/media-list.mdx) [`MediaThumbnail`](/onesource-web3-api-reference/types/objects/media-thumbnail.mdx) [`metadata`](/onesource-web3-api-reference/queries/metadata.mdx) [`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx) [`MetadataReference`](/onesource-web3-api-reference/types/objects/metadata-reference.mdx) [`token`](/onesource-web3-api-reference/queries/token.mdx) [`Token`](/onesource-web3-api-reference/types/objects/token.mdx) [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx) [`transaction`](/onesource-web3-api-reference/queries/transaction.mdx) [`Transaction`](/onesource-web3-api-reference/types/objects/transaction.mdx) [`TransactionFilter`](/onesource-web3-api-reference/types/inputs/transaction-filter.mdx)
---
## Time(Scalars)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
The `Time` scalar type uses the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format to represent date and time:
`YYYY-MM-DDTHH:MM:SSZ`
## Schema Definition
```graphql
scalar Time
```
### Member Of
[`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) [`Contract`](/onesource-web3-api-reference/types/objects/contract.mdx) [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) [`Media`](/onesource-web3-api-reference/types/objects/media.mdx) [`MediaFilter`](/onesource-web3-api-reference/types/inputs/media-filter.mdx) [`MediaThumbnail`](/onesource-web3-api-reference/types/objects/media-thumbnail.mdx) [`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx) [`MetadataFilter`](/onesource-web3-api-reference/types/inputs/metadata-filter.mdx)
---
## UInt256(Scalars)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
`UInt256` is a 256-bit unsigned integer represented as a string to handle extremely large numbers common in blockchain operations.
It is capable of representing values from `0` to `2^256 - 1` and is returned as a string to ensure precision in JavaScript environments.
## Schema Definition
```graphql
scalar UInt256
```
### Member Of
[`balance`](/onesource-web3-api-reference/queries/balance.mdx) [`Balance`](/onesource-web3-api-reference/types/objects/balance.mdx) [`Block`](/onesource-web3-api-reference/types/objects/block.mdx) [`BlockFilter`](/onesource-web3-api-reference/types/inputs/block-filter.mdx) [`BlockTransaction`](/onesource-web3-api-reference/types/objects/block-transaction.mdx) [`BlockTransactionFilter`](/onesource-web3-api-reference/types/inputs/block-transaction-filter.mdx) [`ContractToken`](/onesource-web3-api-reference/types/objects/contract-token.mdx) [`ContractTokenFilter`](/onesource-web3-api-reference/types/inputs/contract-token-filter.mdx) [`holdersCount`](/onesource-web3-api-reference/queries/holders-count.mdx) [`media`](/onesource-web3-api-reference/queries/media.mdx) [`Media`](/onesource-web3-api-reference/types/objects/media.mdx) [`metadata`](/onesource-web3-api-reference/queries/metadata.mdx) [`Metadata`](/onesource-web3-api-reference/types/objects/metadata.mdx) [`token`](/onesource-web3-api-reference/queries/token.mdx) [`Token`](/onesource-web3-api-reference/types/objects/token.mdx) [`TokenFilter`](/onesource-web3-api-reference/types/inputs/token-filter.mdx) [`Transaction`](/onesource-web3-api-reference/types/objects/transaction.mdx) [`TransactionFilter`](/onesource-web3-api-reference/types/inputs/transaction-filter.mdx) [`TransactionStats`](/onesource-web3-api-reference/types/objects/transaction-stats.mdx)
---
## UInt64(Scalars)
export const Bullet = () => <> ● >
export const SpecifiedBy = (props) => <>Specification⎘>
export const Badge = (props) => <>{props.text}>
import { useState } from 'react';
export const Details = ({ dataOpen, dataClose, children, startOpen = false }) => {
const [open, setOpen] = useState(startOpen);
return (
{
e.preventDefault();
setOpen((open) => !open);
}}
style={{ listStyle:'none' }}
>
{open ? dataOpen : dataClose}
{open && children}
);
};
`UInt64` is a 64-bit unsigned integer represented as a string to accommodate large numbers that exceed JavaScript's safe integer limit.
It is capable of representing values from `0` to `(2^64 - 1)` and is returned as a string to ensure precision in JavaScript environments.
## Schema Definition
```graphql
scalar UInt64
```
### Returned By
[`blockCount`](/onesource-web3-api-reference/queries/block-count.mdx) [`holdersCount`](/onesource-web3-api-reference/queries/holders-count.mdx) [`transactionCount`](/onesource-web3-api-reference/queries/transaction-count.mdx)
### Member Of
[`AssetTransaction`](/onesource-web3-api-reference/types/objects/asset-transaction.mdx) [`BalanceList`](/onesource-web3-api-reference/types/objects/balance-list.mdx) [`block`](/onesource-web3-api-reference/queries/block.mdx) [`Block`](/onesource-web3-api-reference/types/objects/block.mdx) [`BlockFilter`](/onesource-web3-api-reference/types/inputs/block-filter.mdx) [`BlockList`](/onesource-web3-api-reference/types/objects/block-list.mdx) [`BlockTransaction`](/onesource-web3-api-reference/types/objects/block-transaction.mdx) [`BlockTransactionFilter`](/onesource-web3-api-reference/types/inputs/block-transaction-filter.mdx) [`BlockTransactionList`](/onesource-web3-api-reference/types/objects/block-transaction-list.mdx) [`Contract`](/onesource-web3-api-reference/types/objects/contract.mdx) [`ContractFilter`](/onesource-web3-api-reference/types/inputs/contract-filter.mdx) [`ContractList`](/onesource-web3-api-reference/types/objects/contract-list.mdx) [`ContractTokenList`](/onesource-web3-api-reference/types/objects/contract-token-list.mdx) [`HoldersList`](/onesource-web3-api-reference/types/objects/holders-list.mdx) [`MediaList`](/onesource-web3-api-reference/types/objects/media-list.mdx) [`MediaThumbnail`](/onesource-web3-api-reference/types/objects/media-thumbnail.mdx) [`MetadataList`](/onesource-web3-api-reference/types/objects/metadata-list.mdx) [`TokenList`](/onesource-web3-api-reference/types/objects/token-list.mdx) [`Transaction`](/onesource-web3-api-reference/types/objects/transaction.mdx) [`TransactionFilter`](/onesource-web3-api-reference/types/inputs/transaction-filter.mdx) [`TransactionList`](/onesource-web3-api-reference/types/objects/transaction-list.mdx) [`TransactionStats`](/onesource-web3-api-reference/types/objects/transaction-stats.mdx)