Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codex-data/sdk",
"version": "1.0.30",
"version": "1.0.31",
"engines": {
"node": ">=17.5.0"
},
Expand Down Expand Up @@ -65,5 +65,8 @@
"merge": "^2.1.1",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1"
},
"resolutions": {
"graphql": "^16.9.0"
}
}
612 changes: 581 additions & 31 deletions src/resources/graphql.schema.json

Large diffs are not rendered by default.

101 changes: 88 additions & 13 deletions src/resources/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export enum ContractType {
export type CreateApiTokensInput = {
/** Number of tokens to create, default is 1 */
count?: InputMaybe<Scalars['Int']['input']>;
/** Number of seconds until the token expires, defaults to 1 hour (3600) */
/** Number of milliseconds until the token expires, defaults to 1 hour (3600000) */
expiresIn?: InputMaybe<Scalars['Int']['input']>;
/** Number of requests allowed per token, represented as a string, default is 5000 */
requestLimit?: InputMaybe<Scalars['String']['input']>;
Expand Down Expand Up @@ -2017,6 +2017,8 @@ export enum LaunchpadTokenProtocol {
BoopFun = 'BoopFun',
/** Protocol name for Clanker. */
Clanker = 'Clanker',
/** Protocol name for Clanker V4. */
ClankerV4 = 'ClankerV4',
/** Protocol name for EgoTech. */
EgoTech = 'EgoTech',
/** Protocol name for Four.meme. */
Expand Down Expand Up @@ -5161,9 +5163,9 @@ export type OnEventsCreatedByMakerInput = {
export type OnLaunchpadTokenEventBatchInput = {
/** The type of event. */
eventType?: InputMaybe<LaunchpadTokenEventType>;
/** The name of the launchpad. One of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
/** The name of the launchpad. One of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
launchpadName?: InputMaybe<Scalars['String']['input']>;
/** A list of launchpad names. Any of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
/** A list of launchpad names. Any of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
launchpadNames?: InputMaybe<Array<Scalars['String']['input']>>;
/** The network ID that the token is deployed on. */
networkId?: InputMaybe<Scalars['Int']['input']>;
Expand All @@ -5179,9 +5181,9 @@ export type OnLaunchpadTokenEventInput = {
address?: InputMaybe<Scalars['String']['input']>;
/** The type of event. */
eventType?: InputMaybe<LaunchpadTokenEventType>;
/** The name of the launchpad. One of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
/** The name of the launchpad. One of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
launchpadName?: InputMaybe<Scalars['String']['input']>;
/** A list of launchpad names. Any of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
/** A list of launchpad names. Any of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
launchpadNames?: InputMaybe<Array<Scalars['String']['input']>>;
/** The network ID that the token is deployed on. */
networkId?: InputMaybe<Scalars['Int']['input']>;
Expand All @@ -5206,11 +5208,20 @@ export type OnTokenBarsUpdatedResponse = {
eventSortKey: Scalars['String']['output'];
/** The network ID the pair is deployed on. */
networkId: Scalars['Int']['output'];
/** The contract address for the pair. */
pairAddress: Scalars['String']['output'];
/** The ID for the pair (`pairAddress`:`networkId`). */
pairId: Scalars['String']['output'];
/** The quote token within the pair. */
/**
* The contract address for the pair.
* @deprecated pairs are no longer used for pricing
*/
pairAddress?: Maybe<Scalars['String']['output']>;
/**
* The ID for the pair (`pairAddress`:`networkId`).
* @deprecated pairs are no longer used for pricing
*/
pairId?: Maybe<Scalars['String']['output']>;
/**
* The quote token within the pair.
* @deprecated pairs are no longer used for pricing
*/
quoteToken?: Maybe<QuoteToken>;
/** The type of statistics used. Can be `Filtered` or `Unfiltered`. */
statsType: TokenPairStatisticsType;
Expand Down Expand Up @@ -5695,6 +5706,8 @@ export type PairMetadata = {
priceChange12?: Maybe<Scalars['Float']['output']>;
/** The percent price change in the past 24 hours. Decimal format. */
priceChange24?: Maybe<Scalars['Float']['output']>;
/** The non-quote token price in USD. */
priceNonQuoteToken: Scalars['String']['output'];
/** The token of interest within the pair. Can be `token0` or `token1`. */
quoteToken?: Maybe<QuoteToken>;
/** The type of statistics returned. Can be `FILTERED` or `UNFILTERED` */
Expand Down Expand Up @@ -6780,6 +6793,8 @@ export type Query = {
getPrimePools?: Maybe<PrimePoolConnection>;
/** Returns charting metadata for a given pair. Used for implementing a Trading View datafeed. */
getSymbol?: Maybe<SymbolResponse>;
/** Returns bar chart data to track price changes over time. */
getTokenBars?: Maybe<TokenBarsResponse>;
/** Returns transactions for a pair. */
getTokenEvents?: Maybe<EventConnection>;
/** Returns a list of token events for a given maker across all pairs. */
Expand Down Expand Up @@ -7193,6 +7208,19 @@ export type QueryGetSymbolArgs = {
};


export type QueryGetTokenBarsArgs = {
countback?: InputMaybe<Scalars['Int']['input']>;
currencyCode?: InputMaybe<QuoteCurrency>;
from: Scalars['Int']['input'];
removeEmptyBars?: InputMaybe<Scalars['Boolean']['input']>;
removeLeadingNullValues?: InputMaybe<Scalars['Boolean']['input']>;
resolution: Scalars['String']['input'];
statsType?: InputMaybe<TokenPairStatisticsType>;
symbol: Scalars['String']['input'];
to: Scalars['Int']['input'];
};


export type QueryGetTokenEventsArgs = {
cursor?: InputMaybe<Scalars['String']['input']>;
direction?: InputMaybe<RankingDirection>;
Expand Down Expand Up @@ -7655,7 +7683,7 @@ export type Subscription = {
onDetailedStatsUpdated?: Maybe<DetailedStats>;
/** Live-streamed event labels for a token. */
onEventLabelCreated?: Maybe<EventLabel>;
/** Live-streamed transactions for a token. */
/** Live-streamed transactions for a pair. */
onEventsCreated?: Maybe<AddEventsOutput>;
/** Live-streamed transactions for a maker. */
onEventsCreatedByMaker?: Maybe<AddEventsByMakerOutput>;
Expand Down Expand Up @@ -8047,6 +8075,47 @@ export enum SymbolType {
Token = 'TOKEN'
}

/** Bar chart data to track price changes over time. */
export type TokenBarsResponse = {
__typename?: 'TokenBarsResponse';
/** The buy volume in USD */
buyVolume: Array<Maybe<Scalars['String']['output']>>;
/** The number of unique buyers */
buyers: Array<Maybe<Scalars['Int']['output']>>;
/** The number of buys */
buys: Array<Maybe<Scalars['Int']['output']>>;
/** The closing price. */
c: Array<Maybe<Scalars['Float']['output']>>;
/** The high price. */
h: Array<Maybe<Scalars['Float']['output']>>;
/** The low price. */
l: Array<Maybe<Scalars['Float']['output']>>;
/** Liquidity in USD */
liquidity: Array<Maybe<Scalars['String']['output']>>;
/** The opening price. */
o: Array<Maybe<Scalars['Float']['output']>>;
/** The status code for the batch: `ok` for successful data retrieval and `no_data` for empty responses signaling the end of server data. */
s: Scalars['String']['output'];
/** The sell volume in USD */
sellVolume: Array<Maybe<Scalars['String']['output']>>;
/** The number of unique sellers */
sellers: Array<Maybe<Scalars['Int']['output']>>;
/** The number of sells */
sells: Array<Maybe<Scalars['Int']['output']>>;
/** The timestamp for the bar. */
t: Array<Scalars['Int']['output']>;
/** The token that is being returned */
token: EnhancedToken;
/** The number of traders */
traders: Array<Maybe<Scalars['Int']['output']>>;
/** The number of transactions */
transactions: Array<Maybe<Scalars['Int']['output']>>;
/** The volume with higher precision. */
volume?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
/** The volume in the native token for the network */
volumeNativeToken?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
};

/** Token burn event data. */
export type TokenBurnEventData = {
__typename?: 'TokenBurnEventData';
Expand Down Expand Up @@ -8324,7 +8393,7 @@ export type TokenFilters = {
launchpadMigrated?: InputMaybe<Scalars['Boolean']['input']>;
/** The timestamp when the launchpad was migrated */
launchpadMigratedAt?: InputMaybe<NumberFilter>;
/** A list of launchpad names. Any of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
/** A list of launchpad names. Any of the following: Pump.fun, Bonk, Baseapp, Zora, Zora Creator, Four.meme, Believe, Moonshot, Jupiter Studio, boop, Heaven, TokenMill V2, Virtuals, Clanker, Clanker V4, ArenaTrade, Moonit, LaunchLab, MeteoraDBC, Vertigo, Cooking.City, time.fun, BAGS, Circus, Dealr, OhFuckFun, PrintFun, Trend, shout.fun, xApple, Sendshot, DubDub, cults. */
launchpadName?: InputMaybe<Array<Scalars['String']['input']>>;
/** A list of launchpad protocols. */
launchpadProtocol?: InputMaybe<Array<Scalars['String']['input']>>;
Expand Down Expand Up @@ -8955,8 +9024,12 @@ export type TokenWalletFilterResult = {
tokenAmountSoldAll1y: Scalars['String']['output'];
/** Token amount sold all in the past 30 days */
tokenAmountSoldAll30d: Scalars['String']['output'];
/** The current token balance */
/** The token balance in the wallet. This value does not update with every transfer and can be slightly stale. Use tokenBalanceLive for live data. */
tokenBalance: Scalars['String']['output'];
/** The current token balance in the wallet. */
tokenBalanceLive?: Maybe<Scalars['String']['output']>;
/** The current USD value of the token balance. */
tokenBalanceLiveUsd?: Maybe<Scalars['String']['output']>;
};

/** A token with metadata. */
Expand Down Expand Up @@ -9167,6 +9240,8 @@ export type UnconfirmedSwapEventData = {

export type UniswapV4Data = {
__typename?: 'UniswapV4Data';
/** Whether the token is the network token for the Uniswap V4 pool. */
isToken0NetworkToken?: Maybe<Scalars['Boolean']['output']>;
type: Scalars['String']['output'];
/** The address of the hook contract for Uniswap V4 pools. */
uniswapV4HookAddress?: Maybe<Scalars['String']['output']>;
Expand Down
14 changes: 11 additions & 3 deletions src/resources/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ type Subscription {
"""The networkId to use when getting all bars per network"""
networkId: Int
): OnTokenBarsUpdatedResponse
"""Live-streamed transactions for a token."""
"""Live-streamed transactions for a pair."""
onEventsCreated(
"""The pair contract address."""
address: String
Expand Down Expand Up @@ -1299,7 +1299,7 @@ input CreateApiTokensInput {
count: Int
"""Number of requests allowed per token, represented as a string, default is 5000"""
requestLimit: String
"""Number of seconds until the token expires, defaults to 1 hour (3600)"""
"""Number of milliseconds until the token expires, defaults to 1 hour (3600000)"""
expiresIn: Int
}

Expand Down Expand Up @@ -6195,6 +6195,8 @@ type PairMetadata {
statsType: TokenPairStatisticsType!
"""The quote token price in USD."""
price: String!
"""The non-quote token price in USD."""
priceNonQuoteToken: String!
"""The percent price change in the past 5 minutes. Decimal format."""
priceChange5m: Float
"""The percent price change in the past hour. Decimal format."""
Expand Down Expand Up @@ -8612,8 +8614,12 @@ type TokenWalletFilterResult {
purchasedTokenBalance: String!
"""The token acquisition cost in USD"""
tokenAcquisitionCostUsd: String!
"""The current token balance"""
"""The token balance in the wallet. This value does not update with every transfer and can be slightly stale. Use tokenBalanceLive for live data."""
tokenBalance: String!
"""The current token balance in the wallet."""
tokenBalanceLive: String
"""The current USD value of the token balance."""
tokenBalanceLiveUsd: String
"""The token metadata"""
token: EnhancedToken!
"""The scammer score for the wallet."""
Expand Down Expand Up @@ -8827,6 +8833,8 @@ type UnconfirmedSwapEventData {
type UniswapV4Data {
"""The address of the hook contract for Uniswap V4 pools."""
uniswapV4HookAddress: String
"""Whether the token is the network token for the Uniswap V4 pool."""
isToken0NetworkToken: Boolean
type: String!
}

Expand Down
5 changes: 3 additions & 2 deletions src/scripts/generateGraphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ export const getLeafType = (

if (type.kind === "UNION") {
// Find all the possible types
const possibleTypes = allTypes.find((t) => t.name === type.name)
?.possibleTypes;
const possibleTypes = allTypes.find(
(t) => t.name === type.name,
)?.possibleTypes;

// For each of the possible types, treat it as a sub object with a set of fields
const possibleTypeLeaves = possibleTypes
Expand Down
14 changes: 6 additions & 8 deletions src/scripts/generateNetworkConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,21 @@

// Create a map of address:networkId -> name
const tokenNameMap = new Map(
tokenData.filterTokens.results.map((result) => [
result.token.id,
result.token.name,
]),
tokenData.filterTokens.results
.filter((result) => result !== null)
.map((result) => [result.token.id, result.token.name]),
);
// Create a map of address:networkId -> decimals
const tokenDecimalsMap = new Map(
tokenData.filterTokens.results.map((result) => [
result.token.id,
result.token.decimals,
]),
tokenData.filterTokens.results
.filter((result) => result !== null)
.map((result) => [result.token.id, result.token.decimals]),
);

// Add baseTokenName to each network config
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const enrichedConfigs = networkConfigs
.map((config: any) => ({

Check warning on line 213 in src/scripts/generateNetworkConfigs.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
...config,
baseTokenName:
tokenNameMap.get(`${config.baseTokenAddress}:${config.networkId}`) ||
Expand Down
27 changes: 24 additions & 3 deletions src/sdk/generated/fragment-masking.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
import { FragmentDefinitionNode } from 'graphql';
import { Incremental } from './graphql';
Expand All @@ -19,25 +20,45 @@ export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
): TType;
// return nullable if `fragmentType` is undefined
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined
): TType | undefined;
// return nullable if `fragmentType` is nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null
): TType | null;
// return nullable if `fragmentType` is nullable or undefined
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
): TType | null | undefined;
// return array of non-nullable if `fragmentType` is array of non-nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>
): Array<TType>;
// return array of nullable if `fragmentType` is array of nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): Array<TType> | null | undefined;
// return readonly array of non-nullable if `fragmentType` is array of non-nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
): ReadonlyArray<TType>;
// return array of nullable if `fragmentType` is array of nullable
// return readonly array of nullable if `fragmentType` is array of nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): ReadonlyArray<TType> | null | undefined;
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): TType | ReadonlyArray<TType> | null | undefined {
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
return fragmentType as any;
}

Expand Down
Loading
Loading