Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.18 KB

File metadata and controls

60 lines (40 loc) · 1.18 KB

Upgrading to v2

There are a few breaking changes in v2 that you need to be aware of.

Imports

All types are now exported directly from the main package.

Before:

import { Codex } from "@codex-data/sdk";
import { TokenRankingAttribute, RankingDirection } from "@codex-data/sdk/dist/sdk/generated/graphql";

After:

import { Codex, TokenRankingAttribute, RankingDirection } from "@codex-data/sdk";

The GraphQL namespace has also been removed:

Before:

import { Codex, GraphQL } from "@codex-data/sdk";

const [quoteToken, setQuoteToken] = useState<GraphQL.QuoteToken>(GraphQL.QuoteToken.Token0);

After:

import { Codex, QuoteToken } from "@codex-data/sdk";

const [quoteToken, setQuoteToken] = useState<QuoteToken>(QuoteToken.Token0);

onLaunchpadTokenEventBatch

The subscription input is now wrapped in an input object.

Before:

const unsubscribeFn = codex.subscriptions.onLaunchpadTokenEventBatch({
  networkId: networkId,
});

After:

const unsubscribeFn = codex.subscriptions.onLaunchpadTokenEventBatch({
  input: {
    networkId: networkId,
  },
});