graphqlEndpoint function

String graphqlEndpoint(
  1. SuiNetwork network
)

Public GraphQL RPC endpoint for a given network.

Unlike gRPC (served by full nodes), GraphQL is served by an indexer. Mysten operates public GraphQL endpoints at graphql.<network>.sui.io. There is no public devnet GraphQL endpoint; SuiNetwork.localnet assumes a locally-run indexer on the default port.

Implementation

String graphqlEndpoint(SuiNetwork network) => switch (network) {
      SuiNetwork.mainnet => 'https://graphql.mainnet.sui.io/graphql',
      SuiNetwork.testnet => 'https://graphql.testnet.sui.io/graphql',
      SuiNetwork.devnet => 'https://graphql.devnet.sui.io/graphql',
      SuiNetwork.localnet => 'http://127.0.0.1:9125/graphql',
    };