Indexer network
Fetch the chain ID
Sequence Indexer GetChainID
Method:
- Request: POST /rpc/Indexer/GetChainID
- Content-Type: application/json
- curl
- Javascript / Typescript
- Go
- Other
curl -X POST -H "Content-Type: application/json" https://mainnet-indexer.sequence.app/rpc/Indexer/GetChainID
// Works in both a Webapp (browser) or Node.js:
import { SequenceIndexerClient } from '@0xsequence/indexer'
const indexer = new SequenceIndexerClient('https://mainnet-indexer.sequence.app')
const { chainID } = await indexer.getChainID()
console.log(chainID) // 1
import (
"context"
"fmt"
"log"
"net/http"
"github.com/0xsequence/go-sequence/indexer"
)
func GetChainID() {
seqIndexer := indexer.NewIndexerClient("https://mainnet-indexer.sequence.app", http.DefaultClient)
chainID, err := seqIndexer.GetChainID(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Println("chainID:", chainID)
}
Please contact our team for assistance with integrations to another target.