JSPM

@settlemint/sdk-thegraph

0.8.6-prefafe2e2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17125
  • Score
    100M100P100Q140193F
  • License FSL-1.1-MIT

SettleMint SDK, integrate SettleMint into your application with ease.

Package Exports

  • @settlemint/sdk-thegraph
  • @settlemint/sdk-thegraph/package.json

Readme

SettleMint logo

SettleMint SDK

https://settlemint.com
Integrate SettleMint into your application with ease.

CI status License npm stars

Documentation   •   Discord   •   NPM   •   Issues

Table of Contents

About

The SettleMint TheGraph SDK provides a seamless way to interact with TheGraph APIs for blockchain data indexing and querying. It enables you to easily create and manage subgraphs, define schemas, and query indexed blockchain data using GraphQL from your SettleMint-powered blockchain networks.

The SDK offers a type-safe interface for all TheGraph operations, with comprehensive error handling and validation. It integrates smoothly with modern TypeScript applications while providing a simple and intuitive developer experience.

For detailed information about using TheGraph with the SettleMint platform, check out our official documentation.

API Reference

Functions

createTheGraphClient()

createTheGraphClient<Setup>(options, clientOptions?): object

Defined in: sdk/thegraph/src/thegraph.ts:62

Creates a Portal client using URQL

Type Parameters
Type Parameter
Setup extends AbstractSetupSchema
Parameters
Parameter Type Description
options Omit<{ accessToken: string; instances: string[]; runtime: "server"; subgraphName: string; } | { runtime: "browser"; subgraphName: string; }, "runtime"> & Record<string, unknown> The client options for configuring the Portal client.
clientOptions? RequestConfig Optional configuration for the URQL client.
Returns

object

An object containing the URQL client and the initialized graphql function.

Name Type Defined in
client GraphQLClient sdk/thegraph/src/thegraph.ts:66
graphql initGraphQLTada<Setup> sdk/thegraph/src/thegraph.ts:67
Throws

Will throw an error if the options fail validation.

Type Aliases

ClientOptions

ClientOptions: z.infer<*typeof* ClientOptionsSchema>

Defined in: sdk/thegraph/src/thegraph.ts:31

Type definition for client options derived from the ClientOptionsSchema.


RequestConfig

RequestConfig: ConstructorParameters<*typeof* GraphQLClient>[1]

Defined in: sdk/thegraph/src/thegraph.ts:10

Options for configuring the URQL client, excluding 'url' and 'exchanges'.

Variables

ClientOptionsSchema

const ClientOptionsSchema: ZodDiscriminatedUnion<"runtime", [ZodObject<{ accessToken: ZodString; instances: ZodArray<ZodUnion<[ZodString, ZodString]>>; runtime: ZodLiteral<"server">; subgraphName: ZodString; }, "strip", { accessToken: string; instances: string[]; runtime: "server"; subgraphName: string; }, { accessToken: string; instances: string[]; runtime: "server"; subgraphName: string; }>, ZodObject<{ runtime: ZodLiteral<"browser">; subgraphName: ZodString; }, "strip", { runtime: "browser"; subgraphName: string; }, { runtime: "browser"; subgraphName: string; }>]>

Defined in: sdk/thegraph/src/thegraph.ts:15

Schema for validating client options for the Portal client.

Contributing

We welcome contributions from the community! Please check out our Contributing guide to learn how you can help improve the SettleMint SDK through bug reports, feature requests, documentation updates, or code contributions.

License

The SettleMint SDK is released under the FSL Software License. See the LICENSE file for more details.