Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
indexer metadataOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Nov 23, 2023
1 parent 86f8aad commit 995fd4c
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 208 deletions.
16 changes: 11 additions & 5 deletions docs/04-indexer/03-fetch-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ import TabItem from '@theme/TabItem'
* Request: POST /rpc/Indexer/GetTokenBalances
* Content-Type: application/json
* Body (in JSON):
* `accountAddress` (string) -- the wallet account address
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `accountAddress` (string) -- the wallet account address
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `metadataOptions` (object - optional) -- additional options for metadata
- `omitUnverified` (boolean - optional) -- omit contracts which are unverified to helps reduce spam
- `includeContracts` ([]string - optional) -- list of specific contract addresses to always be included, even if omitUnverified is enabled.

<br />

Expand Down Expand Up @@ -99,9 +102,12 @@ See section below for more information.
* Request: POST /rpc/Indexer/GetTokenBalances
* Content-Type: application/json
* Body (in JSON):
* `accountAddress` (string) -- the wallet account address
* `contractAddress` (string) -- the contract address of the ERC721 / ERC1155 collection
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `accountAddress` (string) -- the wallet account address
* `contractAddress` (string) -- the contract address of the ERC721 / ERC1155 collection
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `metadataOptions` (object - optional) -- additional options for metadata
- `omitUnverified` (boolean - optional) -- omit contracts which are unverified to helps reduce spam
- `includeContracts` ([]string - optional) -- list of specific contract addresses to always be included, even if omitUnverified is enabled.

<br />

Expand Down
6 changes: 5 additions & 1 deletion docs/04-indexer/04-transaction-history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ The response includes decoded transaction details for easy consumption / renderi
* `metaTransactionIDs` (string array) -- optionally specify a list of meta transaction IDs
* `fromBlock` (number) -- optionally specify the starting block to select a range
* `toBlock` (number) -- optionally specify the ending block to select a range
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `metadataOptions` (object - optional) -- additional options for metadata
- `omitUnverified` (boolean - optional) -- omit contracts which are unverified to helps reduce spam
- `includeContracts` ([]string - optional) -- list of specific contract addresses to always be included, even if omitUnverified is enabled.


<br />

Expand Down
6 changes: 5 additions & 1 deletion docs/04-indexer/05-unique-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ sure to query the indexer of the corresponding network).
* Content-Type: application/json
* Body (in JSON):
* `contractAddress` (string) -- a ERC20 / ERC721 / ERC1155 contract address
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `includeMetadata` (boolean - optional - default: false) -- toggle token metadata to be included in the response
* `metadataOptions` (object - optional) -- additional options for metadata
- `omitUnverified` (boolean - optional) -- omit contracts which are unverified to helps reduce spam
- `includeContracts` ([]string - optional) -- list of specific contract addresses to always be included, even if omitUnverified is enabled.


<br />

Expand Down
27 changes: 27 additions & 0 deletions docs/04-indexer/08-metadata-tips.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
sidebar_label: Metadata Tips & Spam
---

# Metadata Tips & Notes on Spam

The Sequence Indexer and Sequence Metadata services will pick up everything and anything
that is published on a blockchain. Our services are designed to provide data in real-time
as blocks are mined, and adhere to all popular ERC20, ERC721 and ERC1155 metadata
standards so things *just work*.

This is very helpful for your applications to be able to have access to the complete set of data
on-chain, but it also means it will include spam tokens when querying with default settings.

To combat spam, we introduced `metadataOptions` arguments which can be passed to Indexer RPC
calls to control the results returned.

The Sequence Metadata service keeps track of contracts which are "verified" by checking popular
sources like Coingecko, OpenSea, Sequence Builder (https://sequence.build) and the Sequence Token
Directory (https://github.com/0xsequence/token-directory). By calling the Indexer RPC methods with
`"metadataOptions": { "omitUnverified": true }`, any contract address which has not been verified, will
be omitted from the results. We recommend using this option all the time, but, the downside is
if your project's contracts are unverified, then they will also be omitted from the results. To help
with this, your options are to get verified with one of the sources above, or in your RPC calls to pass
`"metadataOptions": { "omitUnverified": true, "includeContracts": ["0x631998e91476DA5B870D741192fc5Cbc55F5a52E", "0x8bb759bb68995343ff1e9d57ac85ff5c5fb79334"] }`
as an example.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0",
"@docusaurus/types": "3.0.0",
"@tsconfig/docusaurus": "^1.0.7",
"@types/react": "^17.0.14",
"@types/react-helmet": "^6.1.2",
"@tsconfig/docusaurus": "^2.0.2",
"@types/react": "^18.2.38",
"@types/react-helmet": "^6.1.9",
"@types/react-router-dom": "^5.3.3",
"docusaurus-plugin-typedoc": "^0.18.0",
"typedoc": "^0.23.28",
"typedoc-plugin-markdown": "^3.13.6",
"typescript": "^5.0.3"
"docusaurus-plugin-typedoc": "^0.21.0",
"typedoc": "^0.25.3",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.3.2"
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit 995fd4c

Please sign in to comment.