diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..18a9bfb --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,57 @@ +name: Bun CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.17.x] + + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + # Removed yarn cache since we are using bun + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + + # --- Subgraph Workspace --- + - name: Install dependencies in subgraph workspace + run: bun install + working-directory: packages/subgraph + + - name: Run subgraph prettier:check + run: bun run prettier:check + working-directory: packages/subgraph + + - name: Run subgraph codegen + run: bun run codegen + working-directory: packages/subgraph + + - name: Run subgraph build + run: bun run build + working-directory: packages/subgraph + + # --- Client Workspace --- + - name: Install dependencies in client workspace + run: bun install + working-directory: packages/graph-client + + - name: Run client prettier:check + run: bun run prettier:check + working-directory: packages/graph-client + + - name: Run client codegen + run: bun run codegen + working-directory: packages/graph-client diff --git a/bun.lockb b/bun.lockb index dfddc30..db7af65 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/graph-client/.eslintrc b/packages/graph-client/.eslintrc new file mode 100644 index 0000000..113f303 --- /dev/null +++ b/packages/graph-client/.eslintrc @@ -0,0 +1,11 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "plugin:@typescript-eslint/recommended", + "prettier", + "prettier/@typescript-eslint" + ] +} \ No newline at end of file diff --git a/packages/graph-client/.graphclient/index.ts b/packages/graph-client/.graphclient/index.ts index 7116f76..d4eadcc 100644 --- a/packages/graph-client/.graphclient/index.ts +++ b/packages/graph-client/.graphclient/index.ts @@ -1,15 +1,23 @@ // @ts-nocheck import { GraphQLResolveInfo, SelectionSetNode, FieldNode, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; -import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; -import { gql } from '@graphql-mesh/utils'; - -import { findAndParseConfig } from '@graphql-mesh/cli'; +import type { GetMeshOptions } from '@graphql-mesh/runtime'; +import type { YamlConfig } from '@graphql-mesh/types'; +import { PubSub } from '@graphql-mesh/utils'; +import { DefaultLogger } from '@graphql-mesh/utils'; +import MeshCache from "@graphql-mesh/cache-localforage"; +import { fetch as fetchFn } from '@whatwg-node/fetch'; + +import { MeshResolvedSource } from '@graphql-mesh/runtime'; +import { MeshTransform, MeshPlugin } from '@graphql-mesh/types'; +import GraphqlHandler from "@graphql-mesh/graphql" +import BareMerger from "@graphql-mesh/merger-bare"; import { createMeshHTTPHandler, MeshHTTPHandler } from '@graphql-mesh/http'; import { getMesh, ExecuteMeshFn, SubscribeMeshFn, MeshContext as BaseMeshContext, MeshInstance } from '@graphql-mesh/runtime'; import { MeshStore, FsStoreStorageAdapter } from '@graphql-mesh/store'; import { path as pathModule } from '@graphql-mesh/cross-helpers'; import { ImportFn } from '@graphql-mesh/types'; -import type { TenderizeTypes } from './sources/Tenderize/types'; +import type { LpEthTypes } from './sources/lpEth/types'; +import * as importedModule$0 from "./sources/lpEth/introspectionSchema"; export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; @@ -545,6 +553,118 @@ export type OrderDirection = | 'asc' | 'desc'; +export type PreLaunch = { + id: Scalars['ID']['output']; + amount: Scalars['BigInt']['output']; + weightedAmount: Scalars['BigInt']['output']; +}; + +export type PreLaunchPosition = { + id: Scalars['ID']['output']; + account: Scalars['Bytes']['output']; + amount: Scalars['BigInt']['output']; + weightedAmount: Scalars['BigInt']['output']; + duration: Scalars['BigInt']['output']; + claimed: Scalars['Boolean']['output']; +}; + +export type PreLaunchPosition_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + account?: InputMaybe; + account_not?: InputMaybe; + account_gt?: InputMaybe; + account_lt?: InputMaybe; + account_gte?: InputMaybe; + account_lte?: InputMaybe; + account_in?: InputMaybe>; + account_not_in?: InputMaybe>; + account_contains?: InputMaybe; + account_not_contains?: InputMaybe; + amount?: InputMaybe; + amount_not?: InputMaybe; + amount_gt?: InputMaybe; + amount_lt?: InputMaybe; + amount_gte?: InputMaybe; + amount_lte?: InputMaybe; + amount_in?: InputMaybe>; + amount_not_in?: InputMaybe>; + weightedAmount?: InputMaybe; + weightedAmount_not?: InputMaybe; + weightedAmount_gt?: InputMaybe; + weightedAmount_lt?: InputMaybe; + weightedAmount_gte?: InputMaybe; + weightedAmount_lte?: InputMaybe; + weightedAmount_in?: InputMaybe>; + weightedAmount_not_in?: InputMaybe>; + duration?: InputMaybe; + duration_not?: InputMaybe; + duration_gt?: InputMaybe; + duration_lt?: InputMaybe; + duration_gte?: InputMaybe; + duration_lte?: InputMaybe; + duration_in?: InputMaybe>; + duration_not_in?: InputMaybe>; + claimed?: InputMaybe; + claimed_not?: InputMaybe; + claimed_in?: InputMaybe>; + claimed_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type PreLaunchPosition_orderBy = + | 'id' + | 'account' + | 'amount' + | 'weightedAmount' + | 'duration' + | 'claimed'; + +export type PreLaunch_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + amount?: InputMaybe; + amount_not?: InputMaybe; + amount_gt?: InputMaybe; + amount_lt?: InputMaybe; + amount_gte?: InputMaybe; + amount_lte?: InputMaybe; + amount_in?: InputMaybe>; + amount_not_in?: InputMaybe>; + weightedAmount?: InputMaybe; + weightedAmount_not?: InputMaybe; + weightedAmount_gt?: InputMaybe; + weightedAmount_lt?: InputMaybe; + weightedAmount_gte?: InputMaybe; + weightedAmount_lte?: InputMaybe; + weightedAmount_in?: InputMaybe>; + weightedAmount_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type PreLaunch_orderBy = + | 'id' + | 'amount' + | 'weightedAmount'; + export type Query = { batchUnlockBought?: Maybe; batchUnlockBoughts: Array; @@ -568,12 +688,16 @@ export type Query = { unlockRedeemeds: Array; withdraw?: Maybe; withdraws: Array; - swapLPTokenTransfer?: Maybe; - swapLPTokenTransfers: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; user?: Maybe; users: Array; liquidityPosition?: Maybe; liquidityPositions: Array; + preLaunchPosition?: Maybe; + preLaunchPositions: Array; + preLaunch?: Maybe; + preLaunches: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -777,19 +901,19 @@ export type QuerywithdrawsArgs = { }; -export type QueryswapLPTokenTransferArgs = { +export type QueryswapLPTokenTransferEventArgs = { id: Scalars['ID']['input']; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; -export type QueryswapLPTokenTransfersArgs = { +export type QueryswapLPTokenTransferEventsArgs = { skip?: InputMaybe; first?: InputMaybe; - orderBy?: InputMaybe; + orderBy?: InputMaybe; orderDirection?: InputMaybe; - where?: InputMaybe; + where?: InputMaybe; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; @@ -831,6 +955,42 @@ export type QueryliquidityPositionsArgs = { }; +export type QuerypreLaunchPositionArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerypreLaunchPositionsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerypreLaunchArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerypreLaunchesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Query_metaArgs = { block?: InputMaybe; }; @@ -936,12 +1096,16 @@ export type Subscription = { unlockRedeemeds: Array; withdraw?: Maybe; withdraws: Array; - swapLPTokenTransfer?: Maybe; - swapLPTokenTransfers: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; user?: Maybe; users: Array; liquidityPosition?: Maybe; liquidityPositions: Array; + preLaunchPosition?: Maybe; + preLaunchPositions: Array; + preLaunch?: Maybe; + preLaunches: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -1145,19 +1309,19 @@ export type SubscriptionwithdrawsArgs = { }; -export type SubscriptionswapLPTokenTransferArgs = { +export type SubscriptionswapLPTokenTransferEventArgs = { id: Scalars['ID']['input']; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; -export type SubscriptionswapLPTokenTransfersArgs = { +export type SubscriptionswapLPTokenTransferEventsArgs = { skip?: InputMaybe; first?: InputMaybe; - orderBy?: InputMaybe; + orderBy?: InputMaybe; orderDirection?: InputMaybe; - where?: InputMaybe; + where?: InputMaybe; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; @@ -1199,6 +1363,42 @@ export type SubscriptionliquidityPositionsArgs = { }; +export type SubscriptionpreLaunchPositionArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionpreLaunchPositionsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionpreLaunchArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionpreLaunchesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Subscription_metaArgs = { block?: InputMaybe; }; @@ -1217,7 +1417,7 @@ export type Swap = { transactionHash: Scalars['Bytes']['output']; }; -export type SwapLPTokenTransfer = { +export type SwapLPTokenTransferEvent = { id: Scalars['ID']['output']; timestamp: Scalars['Int']['output']; blockNumber: Scalars['BigInt']['output']; @@ -1227,7 +1427,7 @@ export type SwapLPTokenTransfer = { SwapPool: SwapPool; }; -export type SwapLPTokenTransfer_filter = { +export type SwapLPTokenTransferEvent_filter = { id?: InputMaybe; id_not?: InputMaybe; id_gt?: InputMaybe; @@ -1323,11 +1523,11 @@ export type SwapLPTokenTransfer_filter = { SwapPool_?: InputMaybe; /** Filter for the block changed event. */ _change_block?: InputMaybe; - and?: InputMaybe>>; - or?: InputMaybe>>; + and?: InputMaybe>>; + or?: InputMaybe>>; }; -export type SwapLPTokenTransfer_orderBy = +export type SwapLPTokenTransferEvent_orderBy = | 'id' | 'timestamp' | 'blockNumber' @@ -2330,6 +2530,12 @@ export type ResolversTypes = ResolversObject<{ LiquidityPosition_filter: LiquidityPosition_filter; LiquidityPosition_orderBy: LiquidityPosition_orderBy; OrderDirection: OrderDirection; + PreLaunch: ResolverTypeWrapper; + PreLaunchPosition: ResolverTypeWrapper; + PreLaunchPosition_filter: PreLaunchPosition_filter; + PreLaunchPosition_orderBy: PreLaunchPosition_orderBy; + PreLaunch_filter: PreLaunch_filter; + PreLaunch_orderBy: PreLaunch_orderBy; Query: ResolverTypeWrapper<{}>; RelayerRewardsClaimed: ResolverTypeWrapper; RelayerRewardsClaimed_filter: RelayerRewardsClaimed_filter; @@ -2337,9 +2543,9 @@ export type ResolversTypes = ResolversObject<{ String: ResolverTypeWrapper; Subscription: ResolverTypeWrapper<{}>; Swap: ResolverTypeWrapper; - SwapLPTokenTransfer: ResolverTypeWrapper; - SwapLPTokenTransfer_filter: SwapLPTokenTransfer_filter; - SwapLPTokenTransfer_orderBy: SwapLPTokenTransfer_orderBy; + SwapLPTokenTransferEvent: ResolverTypeWrapper; + SwapLPTokenTransferEvent_filter: SwapLPTokenTransferEvent_filter; + SwapLPTokenTransferEvent_orderBy: SwapLPTokenTransferEvent_orderBy; SwapPool: ResolverTypeWrapper; SwapPoolDay: ResolverTypeWrapper; SwapPoolDay_filter: SwapPoolDay_filter; @@ -2388,14 +2594,18 @@ export type ResolversParentTypes = ResolversObject<{ Int8: Scalars['Int8']['output']; LiquidityPosition: LiquidityPosition; LiquidityPosition_filter: LiquidityPosition_filter; + PreLaunch: PreLaunch; + PreLaunchPosition: PreLaunchPosition; + PreLaunchPosition_filter: PreLaunchPosition_filter; + PreLaunch_filter: PreLaunch_filter; Query: {}; RelayerRewardsClaimed: RelayerRewardsClaimed; RelayerRewardsClaimed_filter: RelayerRewardsClaimed_filter; String: Scalars['String']['output']; Subscription: {}; Swap: Swap; - SwapLPTokenTransfer: SwapLPTokenTransfer; - SwapLPTokenTransfer_filter: SwapLPTokenTransfer_filter; + SwapLPTokenTransferEvent: SwapLPTokenTransferEvent; + SwapLPTokenTransferEvent_filter: SwapLPTokenTransferEvent_filter; SwapPool: SwapPool; SwapPoolDay: SwapPoolDay; SwapPoolDay_filter: SwapPoolDay_filter; @@ -2503,6 +2713,23 @@ export type LiquidityPositionResolvers; }>; +export type PreLaunchResolvers = ResolversObject<{ + id?: Resolver; + amount?: Resolver; + weightedAmount?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}>; + +export type PreLaunchPositionResolvers = ResolversObject<{ + id?: Resolver; + account?: Resolver; + amount?: Resolver; + weightedAmount?: Resolver; + duration?: Resolver; + claimed?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}>; + export type QueryResolvers = ResolversObject<{ batchUnlockBought?: Resolver, ParentType, ContextType, RequireFields>; batchUnlockBoughts?: Resolver, ParentType, ContextType, RequireFields>; @@ -2526,12 +2753,16 @@ export type QueryResolvers, ParentType, ContextType, RequireFields>; withdraw?: Resolver, ParentType, ContextType, RequireFields>; withdraws?: Resolver, ParentType, ContextType, RequireFields>; - swapLPTokenTransfer?: Resolver, ParentType, ContextType, RequireFields>; - swapLPTokenTransfers?: Resolver, ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvent?: Resolver, ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvents?: Resolver, ParentType, ContextType, RequireFields>; user?: Resolver, ParentType, ContextType, RequireFields>; users?: Resolver, ParentType, ContextType, RequireFields>; liquidityPosition?: Resolver, ParentType, ContextType, RequireFields>; liquidityPositions?: Resolver, ParentType, ContextType, RequireFields>; + preLaunchPosition?: Resolver, ParentType, ContextType, RequireFields>; + preLaunchPositions?: Resolver, ParentType, ContextType, RequireFields>; + preLaunch?: Resolver, ParentType, ContextType, RequireFields>; + preLaunches?: Resolver, ParentType, ContextType, RequireFields>; _meta?: Resolver, ParentType, ContextType, Partial>; }>; @@ -2568,12 +2799,16 @@ export type SubscriptionResolvers, "unlockRedeemeds", ParentType, ContextType, RequireFields>; withdraw?: SubscriptionResolver, "withdraw", ParentType, ContextType, RequireFields>; withdraws?: SubscriptionResolver, "withdraws", ParentType, ContextType, RequireFields>; - swapLPTokenTransfer?: SubscriptionResolver, "swapLPTokenTransfer", ParentType, ContextType, RequireFields>; - swapLPTokenTransfers?: SubscriptionResolver, "swapLPTokenTransfers", ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvent?: SubscriptionResolver, "swapLPTokenTransferEvent", ParentType, ContextType, RequireFields>; + swapLPTokenTransferEvents?: SubscriptionResolver, "swapLPTokenTransferEvents", ParentType, ContextType, RequireFields>; user?: SubscriptionResolver, "user", ParentType, ContextType, RequireFields>; users?: SubscriptionResolver, "users", ParentType, ContextType, RequireFields>; liquidityPosition?: SubscriptionResolver, "liquidityPosition", ParentType, ContextType, RequireFields>; liquidityPositions?: SubscriptionResolver, "liquidityPositions", ParentType, ContextType, RequireFields>; + preLaunchPosition?: SubscriptionResolver, "preLaunchPosition", ParentType, ContextType, RequireFields>; + preLaunchPositions?: SubscriptionResolver, "preLaunchPositions", ParentType, ContextType, RequireFields>; + preLaunch?: SubscriptionResolver, "preLaunch", ParentType, ContextType, RequireFields>; + preLaunches?: SubscriptionResolver, "preLaunches", ParentType, ContextType, RequireFields>; _meta?: SubscriptionResolver, "_meta", ParentType, ContextType, Partial>; }>; @@ -2592,7 +2827,7 @@ export type SwapResolvers; }>; -export type SwapLPTokenTransferResolvers = ResolversObject<{ +export type SwapLPTokenTransferEventResolvers = ResolversObject<{ id?: Resolver; timestamp?: Resolver; blockNumber?: Resolver; @@ -2713,11 +2948,13 @@ export type Resolvers = ResolversObject<{ Deposit?: DepositResolvers; Int8?: GraphQLScalarType; LiquidityPosition?: LiquidityPositionResolvers; + PreLaunch?: PreLaunchResolvers; + PreLaunchPosition?: PreLaunchPositionResolvers; Query?: QueryResolvers; RelayerRewardsClaimed?: RelayerRewardsClaimedResolvers; Subscription?: SubscriptionResolvers; Swap?: SwapResolvers; - SwapLPTokenTransfer?: SwapLPTokenTransferResolvers; + SwapLPTokenTransferEvent?: SwapLPTokenTransferEventResolvers; SwapPool?: SwapPoolResolvers; SwapPoolDay?: SwapPoolDayResolvers; Timestamp?: GraphQLScalarType; @@ -2735,15 +2972,17 @@ export type DirectiveResolvers = ResolversObject<{ derivedFrom?: derivedFromDirectiveResolver; }>; -export type MeshContext = TenderizeTypes.Context & BaseMeshContext; +export type MeshContext = LpEthTypes.Context & BaseMeshContext; -import { fileURLToPath } from '@graphql-mesh/utils'; -const baseDir = pathModule.join(pathModule.dirname(fileURLToPath(import.meta.url)), '..'); +const baseDir = pathModule.join(typeof __dirname === 'string' ? __dirname : '/', '..'); const importFn: ImportFn = (moduleId: string) => { const relativeModuleId = (pathModule.isAbsolute(moduleId) ? pathModule.relative(baseDir, moduleId) : moduleId).split('\\').join('/').replace(baseDir + '/', ''); switch(relativeModuleId) { + case ".graphclient/sources/lpEth/introspectionSchema": + return Promise.resolve(importedModule$0) as T; + default: return Promise.reject(new Error(`Cannot find module '${relativeModuleId}'.`)); } @@ -2758,15 +2997,64 @@ const rootStore = new MeshStore('.graphclient', new FsStoreStorageAdapter({ validate: false }); -export function getMeshOptions() { - console.warn('WARNING: These artifacts are built for development mode. Please run "graphclient build" to build production artifacts'); - return findAndParseConfig({ - dir: baseDir, - artifactsDir: ".graphclient", - configName: "graphclient", - additionalPackagePrefixes: ["@graphprotocol/client-"], - initialLoggerPrefix: "GraphClient", - }); +export const rawServeConfig: YamlConfig.Config['serve'] = undefined as any +export async function getMeshOptions(): Promise { +const pubsub = new PubSub(); +const sourcesStore = rootStore.child('sources'); +const logger = new DefaultLogger("GraphClient"); +const cache = new (MeshCache as any)({ + ...({} as any), + importFn, + store: rootStore.child('cache'), + pubsub, + logger, + } as any) + +const sources: MeshResolvedSource[] = []; +const transforms: MeshTransform[] = []; +const additionalEnvelopPlugins: MeshPlugin[] = []; +const lpEthTransforms = []; +const additionalTypeDefs = [] as any[]; +const lpEthHandler = new GraphqlHandler({ + name: "lpEth", + config: {"endpoint":"https://api.studio.thegraph.com/query/93675/lpeth/version/latest"}, + baseDir, + cache, + pubsub, + store: sourcesStore.child("lpEth"), + logger: logger.child("lpEth"), + importFn, + }); +sources[0] = { + name: 'lpEth', + handler: lpEthHandler, + transforms: lpEthTransforms + } +const additionalResolvers = [] as any[] +const merger = new(BareMerger as any)({ + cache, + pubsub, + logger: logger.child('bareMerger'), + store: rootStore.child('bareMerger') + }) + + return { + sources, + transforms, + additionalTypeDefs, + additionalResolvers, + cache, + pubsub, + merger, + logger, + additionalEnvelopPlugins, + get documents() { + return [ + + ]; + }, + fetchFn, + }; } export function createBuiltMeshHTTPHandler(): MeshHTTPHandler { @@ -2777,6 +3065,7 @@ export function createBuiltMeshHTTPHandler(): MeshHTTPHandl }) } + let meshInstance$: Promise | undefined; export const pollingInterval = null; @@ -2810,107 +3099,4 @@ export function getBuiltGraphClient(): Promise { export const execute: ExecuteMeshFn = (...args) => getBuiltGraphClient().then(({ execute }) => execute(...args)); -export const subscribe: SubscribeMeshFn = (...args) => getBuiltGraphClient().then(({ subscribe }) => subscribe(...args)); -export function getBuiltGraphSDK(globalContext?: TGlobalContext) { - const sdkRequester$ = getBuiltGraphClient().then(({ sdkRequesterFactory }) => sdkRequesterFactory(globalContext)); - return getSdk((...args) => sdkRequester$.then(sdkRequester => sdkRequester(...args))); -} -export type getPoolsQueryVariables = Exact<{ - dateFilter?: InputMaybe; - first?: InputMaybe; - skip?: InputMaybe; -}>; - - -export type getPoolsQuery = { swapPools: Array<( - Pick - & { poolDays: Array> } - )> }; - -export type getPoolQueryVariables = Exact<{ - id: Scalars['ID']['input']; - dateFilter?: InputMaybe; -}>; - - -export type getPoolQuery = { swapPool?: Maybe<( - Pick - & { poolDays: Array> } - )> }; - - -export const getPoolsDocument = gql` - query getPools($dateFilter: Int = 0, $first: Int = 1000, $skip: Int = 0) { - swapPools { - id - lpToken - liabilities - totalSupply - unlocking - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - poolDays(where: {date_gte: $dateFilter}, orderBy: date, orderDirection: desc) { - date - id - liabilities - totalSupply - unlocking - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - } - } -} - ` as unknown as DocumentNode; -export const getPoolDocument = gql` - query getPool($id: ID!, $dateFilter: Int = 0) { - swapPool(id: $id) { - id - lpToken - liabilities - totalSupply - unlocking - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - poolDays(where: {date_gte: $dateFilter}, orderBy: date, orderDirection: desc) { - date - id - liabilities - totalSupply - unlocking - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - } - } -} - ` as unknown as DocumentNode; - - - -export type Requester = (doc: DocumentNode, vars?: V, options?: C) => Promise | AsyncIterable -export function getSdk(requester: Requester) { - return { - getPools(variables?: getPoolsQueryVariables, options?: C): Promise { - return requester(getPoolsDocument, variables, options) as Promise; - }, - getPool(variables: getPoolQueryVariables, options?: C): Promise { - return requester(getPoolDocument, variables, options) as Promise; - } - }; -} -export type Sdk = ReturnType; \ No newline at end of file +export const subscribe: SubscribeMeshFn = (...args) => getBuiltGraphClient().then(({ subscribe }) => subscribe(...args)); \ No newline at end of file diff --git a/packages/graph-client/.graphclient/persisted_operations.json b/packages/graph-client/.graphclient/persisted_operations.json deleted file mode 100644 index b388728..0000000 --- a/packages/graph-client/.graphclient/persisted_operations.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "98c63358415be36b74d4c017fc8198b826be5620510a9413d010570af1b4c69f": "query getPools($dateFilter: Int = 0, $first: Int = 1000, $skip: Int = 0) {\n swapPools {\n id\n lpToken\n liabilities\n totalSupply\n unlocking\n volume\n volumeUSD\n fees\n feesUSD\n lpRewards\n lpRewardsUSD\n poolDays(where: {date_gte: $dateFilter}, orderBy: date, orderDirection: desc) {\n date\n id\n liabilities\n totalSupply\n unlocking\n volume\n volumeUSD\n fees\n feesUSD\n lpRewards\n lpRewardsUSD\n }\n }\n}\n\nquery getPool($id: ID!, $dateFilter: Int = 0) {\n swapPool(id: $id) {\n id\n lpToken\n liabilities\n totalSupply\n unlocking\n volume\n volumeUSD\n fees\n feesUSD\n lpRewards\n lpRewardsUSD\n poolDays(where: {date_gte: $dateFilter}, orderBy: date, orderDirection: desc) {\n date\n id\n liabilities\n totalSupply\n unlocking\n volume\n volumeUSD\n fees\n feesUSD\n lpRewards\n lpRewardsUSD\n }\n }\n}" -} \ No newline at end of file diff --git a/packages/graph-client/.graphclient/schema.graphql b/packages/graph-client/.graphclient/schema.graphql index 22e29a3..d2d5a8e 100644 --- a/packages/graph-client/.graphclient/schema.graphql +++ b/packages/graph-client/.graphclient/schema.graphql @@ -545,6 +545,120 @@ enum OrderDirection { desc } +type PreLaunch { + id: ID! + amount: BigInt! + weightedAmount: BigInt! +} + +type PreLaunchPosition { + id: ID! + account: Bytes! + amount: BigInt! + weightedAmount: BigInt! + duration: BigInt! + claimed: Boolean! +} + +input PreLaunchPosition_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + account: Bytes + account_not: Bytes + account_gt: Bytes + account_lt: Bytes + account_gte: Bytes + account_lte: Bytes + account_in: [Bytes!] + account_not_in: [Bytes!] + account_contains: Bytes + account_not_contains: Bytes + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + weightedAmount: BigInt + weightedAmount_not: BigInt + weightedAmount_gt: BigInt + weightedAmount_lt: BigInt + weightedAmount_gte: BigInt + weightedAmount_lte: BigInt + weightedAmount_in: [BigInt!] + weightedAmount_not_in: [BigInt!] + duration: BigInt + duration_not: BigInt + duration_gt: BigInt + duration_lt: BigInt + duration_gte: BigInt + duration_lte: BigInt + duration_in: [BigInt!] + duration_not_in: [BigInt!] + claimed: Boolean + claimed_not: Boolean + claimed_in: [Boolean!] + claimed_not_in: [Boolean!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [PreLaunchPosition_filter] + or: [PreLaunchPosition_filter] +} + +enum PreLaunchPosition_orderBy { + id + account + amount + weightedAmount + duration + claimed +} + +input PreLaunch_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + weightedAmount: BigInt + weightedAmount_not: BigInt + weightedAmount_gt: BigInt + weightedAmount_lt: BigInt + weightedAmount_gte: BigInt + weightedAmount_lte: BigInt + weightedAmount_in: [BigInt!] + weightedAmount_not_in: [BigInt!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [PreLaunch_filter] + or: [PreLaunch_filter] +} + +enum PreLaunch_orderBy { + id + amount + weightedAmount +} + type Query { batchUnlockBought( id: ID! @@ -832,7 +946,7 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [Withdraw!]! - swapLPTokenTransfer( + swapLPTokenTransferEvent( id: ID! """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. @@ -842,13 +956,13 @@ type Query { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): SwapLPTokenTransfer - swapLPTokenTransfers( + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( skip: Int = 0 first: Int = 100 - orderBy: SwapLPTokenTransfer_orderBy + orderBy: SwapLPTokenTransferEvent_orderBy orderDirection: OrderDirection - where: SwapLPTokenTransfer_filter + where: SwapLPTokenTransferEvent_filter """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. """ @@ -857,7 +971,7 @@ type Query { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): [SwapLPTokenTransfer!]! + ): [SwapLPTokenTransferEvent!]! user( id: ID! """ @@ -910,6 +1024,58 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [LiquidityPosition!]! + preLaunchPosition( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunchPosition + preLaunchPositions( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunchPosition_orderBy + orderDirection: OrderDirection + where: PreLaunchPosition_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunchPosition!]! + preLaunch( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunch + preLaunches( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunch_orderBy + orderDirection: OrderDirection + where: PreLaunch_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunch!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } @@ -1280,7 +1446,7 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [Withdraw!]! - swapLPTokenTransfer( + swapLPTokenTransferEvent( id: ID! """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. @@ -1290,13 +1456,13 @@ type Subscription { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): SwapLPTokenTransfer - swapLPTokenTransfers( + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( skip: Int = 0 first: Int = 100 - orderBy: SwapLPTokenTransfer_orderBy + orderBy: SwapLPTokenTransferEvent_orderBy orderDirection: OrderDirection - where: SwapLPTokenTransfer_filter + where: SwapLPTokenTransferEvent_filter """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. """ @@ -1305,7 +1471,7 @@ type Subscription { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): [SwapLPTokenTransfer!]! + ): [SwapLPTokenTransferEvent!]! user( id: ID! """ @@ -1358,6 +1524,58 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [LiquidityPosition!]! + preLaunchPosition( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunchPosition + preLaunchPositions( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunchPosition_orderBy + orderDirection: OrderDirection + where: PreLaunchPosition_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunchPosition!]! + preLaunch( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunch + preLaunches( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunch_orderBy + orderDirection: OrderDirection + where: PreLaunch_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunch!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } @@ -1376,7 +1594,7 @@ type Swap { transactionHash: Bytes! } -type SwapLPTokenTransfer { +type SwapLPTokenTransferEvent { id: ID! timestamp: Int! blockNumber: BigInt! @@ -1386,7 +1604,7 @@ type SwapLPTokenTransfer { SwapPool: SwapPool! } -input SwapLPTokenTransfer_filter { +input SwapLPTokenTransferEvent_filter { id: ID id_not: ID id_gt: ID @@ -1482,11 +1700,11 @@ input SwapLPTokenTransfer_filter { SwapPool_: SwapPool_filter """Filter for the block changed event.""" _change_block: BlockChangedFilter - and: [SwapLPTokenTransfer_filter] - or: [SwapLPTokenTransfer_filter] + and: [SwapLPTokenTransferEvent_filter] + or: [SwapLPTokenTransferEvent_filter] } -enum SwapLPTokenTransfer_orderBy { +enum SwapLPTokenTransferEvent_orderBy { id timestamp blockNumber diff --git a/packages/graph-client/.graphclient/sources/Tenderize/introspectionSchema.ts b/packages/graph-client/.graphclient/sources/lpEth/introspectionSchema.ts similarity index 91% rename from packages/graph-client/.graphclient/sources/Tenderize/introspectionSchema.ts rename to packages/graph-client/.graphclient/sources/lpEth/introspectionSchema.ts index 2b8c1e3..0de16c9 100644 --- a/packages/graph-client/.graphclient/sources/Tenderize/introspectionSchema.ts +++ b/packages/graph-client/.graphclient/sources/lpEth/introspectionSchema.ts @@ -7499,14 +7499,2065 @@ const schemaAST = { "kind": "ObjectTypeDefinition", "name": { "kind": "Name", - "value": "Query" + "value": "PreLaunch" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "PreLaunchPosition" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "account" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "duration" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "claimed" + }, + "arguments": [], + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" + } + } + }, + "directives": [] + } + ], + "interfaces": [], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "PreLaunchPosition_filter" }, "fields": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "account_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "duration_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "claimed" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "claimed_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "claimed_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "claimed_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Boolean" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, + "name": { + "kind": "Name", + "value": "_change_block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "PreLaunchPosition_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "PreLaunchPosition_filter" + } + } + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "PreLaunchPosition_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "account" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "duration" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "claimed" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "InputObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "PreLaunch_filter" + }, + "fields": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "amount_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_not" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BigInt" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, + "name": { + "kind": "Name", + "value": "_change_block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "PreLaunch_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "PreLaunch_filter" + } + } + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "PreLaunch_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "amount" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "weightedAmount" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Query" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "batchUnlockBought" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockBought" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "batchUnlockBoughts" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockBought_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockBought_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockBought" + } + } + } + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "batchUnlockRedeemed" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockRedeemed" + } + }, + "directives": [] + }, + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "batchUnlockRedeemeds" + }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockRedeemed_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockRedeemed_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], + "type": { + "kind": "NonNullType", + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockRedeemed" + } + } + } + } + }, + "directives": [] + }, { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockBought" + "value": "claimWithdrawRequest" }, "arguments": [ { @@ -7579,7 +9630,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought" + "value": "ClaimWithdrawRequest" } }, "directives": [] @@ -7588,7 +9639,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockBoughts" + "value": "claimWithdrawRequests" }, "arguments": [ { @@ -7639,7 +9690,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought_orderBy" + "value": "ClaimWithdrawRequest_orderBy" } }, "directives": [] @@ -7669,7 +9720,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought_filter" + "value": "ClaimWithdrawRequest_filter" } }, "directives": [] @@ -7732,7 +9783,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought" + "value": "ClaimWithdrawRequest" } } } @@ -7744,7 +9795,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockRedeemed" + "value": "swap" }, "arguments": [ { @@ -7817,7 +9868,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed" + "value": "Swap" } }, "directives": [] @@ -7826,7 +9877,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockRedeemeds" + "value": "swaps" }, "arguments": [ { @@ -7877,7 +9928,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed_orderBy" + "value": "Swap_orderBy" } }, "directives": [] @@ -7907,7 +9958,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed_filter" + "value": "Swap_filter" } }, "directives": [] @@ -7970,7 +10021,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed" + "value": "Swap" } } } @@ -7982,7 +10033,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claimWithdrawRequest" + "value": "deposit" }, "arguments": [ { @@ -8055,7 +10106,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest" + "value": "Deposit" } }, "directives": [] @@ -8064,7 +10115,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claimWithdrawRequests" + "value": "deposits" }, "arguments": [ { @@ -8115,7 +10166,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest_orderBy" + "value": "Deposit_orderBy" } }, "directives": [] @@ -8145,7 +10196,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest_filter" + "value": "Deposit_filter" } }, "directives": [] @@ -8208,7 +10259,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest" + "value": "Deposit" } } } @@ -8220,7 +10271,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swap" + "value": "relayerRewardsClaimed" }, "arguments": [ { @@ -8293,7 +10344,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap" + "value": "RelayerRewardsClaimed" } }, "directives": [] @@ -8302,7 +10353,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swaps" + "value": "relayerRewardsClaimeds" }, "arguments": [ { @@ -8353,7 +10404,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap_orderBy" + "value": "RelayerRewardsClaimed_orderBy" } }, "directives": [] @@ -8383,7 +10434,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap_filter" + "value": "RelayerRewardsClaimed_filter" } }, "directives": [] @@ -8446,7 +10497,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap" + "value": "RelayerRewardsClaimed" } } } @@ -8458,7 +10509,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "deposit" + "value": "swapPool" }, "arguments": [ { @@ -8531,7 +10582,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit" + "value": "SwapPool" } }, "directives": [] @@ -8540,7 +10591,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "deposits" + "value": "swapPools" }, "arguments": [ { @@ -8591,7 +10642,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit_orderBy" + "value": "SwapPool_orderBy" } }, "directives": [] @@ -8621,7 +10672,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit_filter" + "value": "SwapPool_filter" } }, "directives": [] @@ -8684,7 +10735,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit" + "value": "SwapPool" } } } @@ -8696,7 +10747,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "relayerRewardsClaimed" + "value": "swapPoolDay" }, "arguments": [ { @@ -8769,7 +10820,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed" + "value": "SwapPoolDay" } }, "directives": [] @@ -8778,7 +10829,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "relayerRewardsClaimeds" + "value": "swapPoolDays" }, "arguments": [ { @@ -8829,7 +10880,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed_orderBy" + "value": "SwapPoolDay_orderBy" } }, "directives": [] @@ -8859,7 +10910,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed_filter" + "value": "SwapPoolDay_filter" } }, "directives": [] @@ -8922,7 +10973,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed" + "value": "SwapPoolDay" } } } @@ -8934,7 +10985,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPool" + "value": "unlockBought" }, "arguments": [ { @@ -9007,7 +11058,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool" + "value": "UnlockBought" } }, "directives": [] @@ -9016,7 +11067,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPools" + "value": "unlockBoughts" }, "arguments": [ { @@ -9067,7 +11118,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool_orderBy" + "value": "UnlockBought_orderBy" } }, "directives": [] @@ -9097,7 +11148,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool_filter" + "value": "UnlockBought_filter" } }, "directives": [] @@ -9160,7 +11211,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool" + "value": "UnlockBought" } } } @@ -9172,7 +11223,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPoolDay" + "value": "unlockRedeemed" }, "arguments": [ { @@ -9245,7 +11296,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay" + "value": "UnlockRedeemed" } }, "directives": [] @@ -9254,7 +11305,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPoolDays" + "value": "unlockRedeemeds" }, "arguments": [ { @@ -9305,7 +11356,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay_orderBy" + "value": "UnlockRedeemed_orderBy" } }, "directives": [] @@ -9335,7 +11386,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay_filter" + "value": "UnlockRedeemed_filter" } }, "directives": [] @@ -9398,7 +11449,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay" + "value": "UnlockRedeemed" } } } @@ -9410,7 +11461,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockBought" + "value": "withdraw" }, "arguments": [ { @@ -9483,7 +11534,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought" + "value": "Withdraw" } }, "directives": [] @@ -9492,7 +11543,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockBoughts" + "value": "withdraws" }, "arguments": [ { @@ -9543,7 +11594,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought_orderBy" + "value": "Withdraw_orderBy" } }, "directives": [] @@ -9573,7 +11624,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought_filter" + "value": "Withdraw_filter" } }, "directives": [] @@ -9636,7 +11687,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought" + "value": "Withdraw" } } } @@ -9648,7 +11699,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockRedeemed" + "value": "swapLPTokenTransferEvent" }, "arguments": [ { @@ -9721,7 +11772,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed" + "value": "SwapLPTokenTransferEvent" } }, "directives": [] @@ -9730,7 +11781,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockRedeemeds" + "value": "swapLPTokenTransferEvents" }, "arguments": [ { @@ -9781,7 +11832,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed_orderBy" + "value": "SwapLPTokenTransferEvent_orderBy" } }, "directives": [] @@ -9811,7 +11862,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed_filter" + "value": "SwapLPTokenTransferEvent_filter" } }, "directives": [] @@ -9874,7 +11925,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed" + "value": "SwapLPTokenTransferEvent" } } } @@ -9886,7 +11937,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "withdraw" + "value": "user" }, "arguments": [ { @@ -9959,7 +12010,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw" + "value": "User" } }, "directives": [] @@ -9968,7 +12019,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "withdraws" + "value": "users" }, "arguments": [ { @@ -10019,7 +12070,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw_orderBy" + "value": "User_orderBy" } }, "directives": [] @@ -10049,7 +12100,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw_filter" + "value": "User_filter" } }, "directives": [] @@ -10112,7 +12163,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw" + "value": "User" } } } @@ -10124,7 +12175,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapLPTokenTransfer" + "value": "liquidityPosition" }, "arguments": [ { @@ -10197,7 +12248,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer" + "value": "LiquidityPosition" } }, "directives": [] @@ -10206,7 +12257,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapLPTokenTransfers" + "value": "liquidityPositions" }, "arguments": [ { @@ -10257,7 +12308,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_orderBy" + "value": "LiquidityPosition_orderBy" } }, "directives": [] @@ -10287,7 +12338,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_filter" + "value": "LiquidityPosition_filter" } }, "directives": [] @@ -10350,7 +12401,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer" + "value": "LiquidityPosition" } } } @@ -10362,7 +12413,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "user" + "value": "preLaunchPosition" }, "arguments": [ { @@ -10435,7 +12486,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User" + "value": "PreLaunchPosition" } }, "directives": [] @@ -10444,7 +12495,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "users" + "value": "preLaunchPositions" }, "arguments": [ { @@ -10495,7 +12546,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User_orderBy" + "value": "PreLaunchPosition_orderBy" } }, "directives": [] @@ -10525,7 +12576,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User_filter" + "value": "PreLaunchPosition_filter" } }, "directives": [] @@ -10588,7 +12639,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User" + "value": "PreLaunchPosition" } } } @@ -10600,7 +12651,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "liquidityPosition" + "value": "preLaunch" }, "arguments": [ { @@ -10673,7 +12724,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition" + "value": "PreLaunch" } }, "directives": [] @@ -10682,7 +12733,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "liquidityPositions" + "value": "preLaunches" }, "arguments": [ { @@ -10733,7 +12784,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition_orderBy" + "value": "PreLaunch_orderBy" } }, "directives": [] @@ -10763,7 +12814,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition_filter" + "value": "PreLaunch_filter" } }, "directives": [] @@ -10826,7 +12877,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition" + "value": "PreLaunch" } } } @@ -11758,80 +13809,493 @@ const schemaAST = { "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_gt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_lt" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_gte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_lte" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_not_in" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "transactionHash_not_contains" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Bytes" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Filter for the block changed event.", + "block": true + }, + "name": { + "kind": "Name", + "value": "_change_block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BlockChangedFilter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "and" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "RelayerRewardsClaimed_filter" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "or" + }, + "type": { + "kind": "ListType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "RelayerRewardsClaimed_filter" + } + } + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "EnumTypeDefinition", + "name": { + "kind": "Name", + "value": "RelayerRewardsClaimed_orderBy" + }, + "values": [ + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", + "name": { + "kind": "Name", + "value": "relayer" + }, + "directives": [] + }, + { + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "transactionHash_gt" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } + "value": "rewards" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "transactionHash_lt" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } + "value": "blockNumber" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "transactionHash_gte" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } + "value": "blockTimestamp" }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "EnumValueDefinition", "name": { "kind": "Name", - "value": "transactionHash_lte" + "value": "transactionHash" + }, + "directives": [] + } + ], + "directives": [] + }, + { + "kind": "ObjectTypeDefinition", + "name": { + "kind": "Name", + "value": "Subscription" + }, + "fields": [ + { + "kind": "FieldDefinition", + "name": { + "kind": "Name", + "value": "batchUnlockBought" }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "BatchUnlockBought" } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "transactionHash_in" + "value": "batchUnlockBoughts" }, + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockBought_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockBought_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] + } + ], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NonNullType", + "kind": "ListType", "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockBought" + } } } } @@ -11839,185 +14303,248 @@ const schemaAST = { "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "transactionHash_not_in" + "value": "batchUnlockRedeemed" }, - "type": { - "kind": "ListType", - "type": { - "kind": "NonNullType", + "arguments": [ + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "id" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "ID" + } + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "Bytes" + "value": "Block_height" } - } - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "transactionHash_contains" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" - } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "transactionHash_not_contains" - }, - "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "Bytes" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "description": { - "kind": "StringValue", - "value": "Filter for the block changed event.", - "block": true - }, - "name": { - "kind": "Name", - "value": "_change_block" - }, + ], "type": { "kind": "NamedType", "name": { "kind": "Name", - "value": "BlockChangedFilter" + "value": "BatchUnlockRedeemed" } }, "directives": [] }, { - "kind": "InputValueDefinition", + "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "and" + "value": "batchUnlockRedeemeds" }, - "type": { - "kind": "ListType", - "type": { - "kind": "NamedType", + "arguments": [ + { + "kind": "InputValueDefinition", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed_filter" - } + "value": "skip" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "0" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "first" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Int" + } + }, + "defaultValue": { + "kind": "IntValue", + "value": "100" + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderBy" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockRedeemed_orderBy" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "orderDirection" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "OrderDirection" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "name": { + "kind": "Name", + "value": "where" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockRedeemed_filter" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.", + "block": true + }, + "name": { + "kind": "Name", + "value": "block" + }, + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "Block_height" + } + }, + "directives": [] + }, + { + "kind": "InputValueDefinition", + "description": { + "kind": "StringValue", + "value": "Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.", + "block": true + }, + "name": { + "kind": "Name", + "value": "subgraphError" + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "_SubgraphErrorPolicy_" + } + } + }, + "defaultValue": { + "kind": "EnumValue", + "value": "deny" + }, + "directives": [] } - }, - "directives": [] - }, - { - "kind": "InputValueDefinition", - "name": { - "kind": "Name", - "value": "or" - }, + ], "type": { - "kind": "ListType", + "kind": "NonNullType", "type": { - "kind": "NamedType", - "name": { - "kind": "Name", - "value": "RelayerRewardsClaimed_filter" + "kind": "ListType", + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { + "kind": "Name", + "value": "BatchUnlockRedeemed" + } + } } } }, "directives": [] - } - ], - "directives": [] - }, - { - "kind": "EnumTypeDefinition", - "name": { - "kind": "Name", - "value": "RelayerRewardsClaimed_orderBy" - }, - "values": [ - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "id" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "relayer" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "rewards" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "blockNumber" - }, - "directives": [] - }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "blockTimestamp" - }, - "directives": [] }, - { - "kind": "EnumValueDefinition", - "name": { - "kind": "Name", - "value": "transactionHash" - }, - "directives": [] - } - ], - "directives": [] - }, - { - "kind": "ObjectTypeDefinition", - "name": { - "kind": "Name", - "value": "Subscription" - }, - "fields": [ { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockBought" + "value": "claimWithdrawRequest" }, "arguments": [ { @@ -12090,7 +14617,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought" + "value": "ClaimWithdrawRequest" } }, "directives": [] @@ -12099,7 +14626,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockBoughts" + "value": "claimWithdrawRequests" }, "arguments": [ { @@ -12150,7 +14677,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought_orderBy" + "value": "ClaimWithdrawRequest_orderBy" } }, "directives": [] @@ -12180,7 +14707,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought_filter" + "value": "ClaimWithdrawRequest_filter" } }, "directives": [] @@ -12243,7 +14770,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockBought" + "value": "ClaimWithdrawRequest" } } } @@ -12255,7 +14782,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockRedeemed" + "value": "swap" }, "arguments": [ { @@ -12328,7 +14855,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed" + "value": "Swap" } }, "directives": [] @@ -12337,7 +14864,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "batchUnlockRedeemeds" + "value": "swaps" }, "arguments": [ { @@ -12388,7 +14915,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed_orderBy" + "value": "Swap_orderBy" } }, "directives": [] @@ -12418,7 +14945,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed_filter" + "value": "Swap_filter" } }, "directives": [] @@ -12481,7 +15008,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "BatchUnlockRedeemed" + "value": "Swap" } } } @@ -12493,7 +15020,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claimWithdrawRequest" + "value": "deposit" }, "arguments": [ { @@ -12566,7 +15093,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest" + "value": "Deposit" } }, "directives": [] @@ -12575,7 +15102,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "claimWithdrawRequests" + "value": "deposits" }, "arguments": [ { @@ -12626,7 +15153,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest_orderBy" + "value": "Deposit_orderBy" } }, "directives": [] @@ -12656,7 +15183,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest_filter" + "value": "Deposit_filter" } }, "directives": [] @@ -12719,7 +15246,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "ClaimWithdrawRequest" + "value": "Deposit" } } } @@ -12731,7 +15258,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swap" + "value": "relayerRewardsClaimed" }, "arguments": [ { @@ -12804,7 +15331,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap" + "value": "RelayerRewardsClaimed" } }, "directives": [] @@ -12813,7 +15340,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swaps" + "value": "relayerRewardsClaimeds" }, "arguments": [ { @@ -12864,7 +15391,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap_orderBy" + "value": "RelayerRewardsClaimed_orderBy" } }, "directives": [] @@ -12894,7 +15421,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap_filter" + "value": "RelayerRewardsClaimed_filter" } }, "directives": [] @@ -12957,7 +15484,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Swap" + "value": "RelayerRewardsClaimed" } } } @@ -12969,7 +15496,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "deposit" + "value": "swapPool" }, "arguments": [ { @@ -13042,7 +15569,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit" + "value": "SwapPool" } }, "directives": [] @@ -13051,7 +15578,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "deposits" + "value": "swapPools" }, "arguments": [ { @@ -13102,7 +15629,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit_orderBy" + "value": "SwapPool_orderBy" } }, "directives": [] @@ -13132,7 +15659,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit_filter" + "value": "SwapPool_filter" } }, "directives": [] @@ -13195,7 +15722,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Deposit" + "value": "SwapPool" } } } @@ -13207,7 +15734,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "relayerRewardsClaimed" + "value": "swapPoolDay" }, "arguments": [ { @@ -13280,7 +15807,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed" + "value": "SwapPoolDay" } }, "directives": [] @@ -13289,7 +15816,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "relayerRewardsClaimeds" + "value": "swapPoolDays" }, "arguments": [ { @@ -13340,7 +15867,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed_orderBy" + "value": "SwapPoolDay_orderBy" } }, "directives": [] @@ -13370,7 +15897,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed_filter" + "value": "SwapPoolDay_filter" } }, "directives": [] @@ -13433,7 +15960,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "RelayerRewardsClaimed" + "value": "SwapPoolDay" } } } @@ -13445,7 +15972,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPool" + "value": "unlockBought" }, "arguments": [ { @@ -13518,7 +16045,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool" + "value": "UnlockBought" } }, "directives": [] @@ -13527,7 +16054,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPools" + "value": "unlockBoughts" }, "arguments": [ { @@ -13578,7 +16105,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool_orderBy" + "value": "UnlockBought_orderBy" } }, "directives": [] @@ -13608,7 +16135,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool_filter" + "value": "UnlockBought_filter" } }, "directives": [] @@ -13671,7 +16198,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPool" + "value": "UnlockBought" } } } @@ -13683,7 +16210,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPoolDay" + "value": "unlockRedeemed" }, "arguments": [ { @@ -13756,7 +16283,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay" + "value": "UnlockRedeemed" } }, "directives": [] @@ -13765,7 +16292,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapPoolDays" + "value": "unlockRedeemeds" }, "arguments": [ { @@ -13816,7 +16343,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay_orderBy" + "value": "UnlockRedeemed_orderBy" } }, "directives": [] @@ -13846,7 +16373,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay_filter" + "value": "UnlockRedeemed_filter" } }, "directives": [] @@ -13909,7 +16436,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapPoolDay" + "value": "UnlockRedeemed" } } } @@ -13921,7 +16448,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockBought" + "value": "withdraw" }, "arguments": [ { @@ -13994,7 +16521,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought" + "value": "Withdraw" } }, "directives": [] @@ -14003,7 +16530,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockBoughts" + "value": "withdraws" }, "arguments": [ { @@ -14054,7 +16581,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought_orderBy" + "value": "Withdraw_orderBy" } }, "directives": [] @@ -14084,7 +16611,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought_filter" + "value": "Withdraw_filter" } }, "directives": [] @@ -14147,7 +16674,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockBought" + "value": "Withdraw" } } } @@ -14159,7 +16686,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockRedeemed" + "value": "swapLPTokenTransferEvent" }, "arguments": [ { @@ -14232,7 +16759,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed" + "value": "SwapLPTokenTransferEvent" } }, "directives": [] @@ -14241,7 +16768,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "unlockRedeemeds" + "value": "swapLPTokenTransferEvents" }, "arguments": [ { @@ -14292,7 +16819,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed_orderBy" + "value": "SwapLPTokenTransferEvent_orderBy" } }, "directives": [] @@ -14322,7 +16849,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed_filter" + "value": "SwapLPTokenTransferEvent_filter" } }, "directives": [] @@ -14385,7 +16912,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "UnlockRedeemed" + "value": "SwapLPTokenTransferEvent" } } } @@ -14397,7 +16924,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "withdraw" + "value": "user" }, "arguments": [ { @@ -14470,7 +16997,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw" + "value": "User" } }, "directives": [] @@ -14479,7 +17006,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "withdraws" + "value": "users" }, "arguments": [ { @@ -14530,7 +17057,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw_orderBy" + "value": "User_orderBy" } }, "directives": [] @@ -14560,7 +17087,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw_filter" + "value": "User_filter" } }, "directives": [] @@ -14623,7 +17150,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "Withdraw" + "value": "User" } } } @@ -14635,7 +17162,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapLPTokenTransfer" + "value": "liquidityPosition" }, "arguments": [ { @@ -14708,7 +17235,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer" + "value": "LiquidityPosition" } }, "directives": [] @@ -14717,7 +17244,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "swapLPTokenTransfers" + "value": "liquidityPositions" }, "arguments": [ { @@ -14768,7 +17295,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_orderBy" + "value": "LiquidityPosition_orderBy" } }, "directives": [] @@ -14798,7 +17325,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_filter" + "value": "LiquidityPosition_filter" } }, "directives": [] @@ -14861,7 +17388,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer" + "value": "LiquidityPosition" } } } @@ -14873,7 +17400,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "user" + "value": "preLaunchPosition" }, "arguments": [ { @@ -14946,7 +17473,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User" + "value": "PreLaunchPosition" } }, "directives": [] @@ -14955,7 +17482,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "users" + "value": "preLaunchPositions" }, "arguments": [ { @@ -15006,7 +17533,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User_orderBy" + "value": "PreLaunchPosition_orderBy" } }, "directives": [] @@ -15036,7 +17563,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User_filter" + "value": "PreLaunchPosition_filter" } }, "directives": [] @@ -15099,7 +17626,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "User" + "value": "PreLaunchPosition" } } } @@ -15111,7 +17638,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "liquidityPosition" + "value": "preLaunch" }, "arguments": [ { @@ -15184,7 +17711,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition" + "value": "PreLaunch" } }, "directives": [] @@ -15193,7 +17720,7 @@ const schemaAST = { "kind": "FieldDefinition", "name": { "kind": "Name", - "value": "liquidityPositions" + "value": "preLaunches" }, "arguments": [ { @@ -15244,7 +17771,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition_orderBy" + "value": "PreLaunch_orderBy" } }, "directives": [] @@ -15274,7 +17801,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition_filter" + "value": "PreLaunch_filter" } }, "directives": [] @@ -15337,7 +17864,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "LiquidityPosition" + "value": "PreLaunch" } } } @@ -15610,7 +18137,7 @@ const schemaAST = { "kind": "ObjectTypeDefinition", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer" + "value": "SwapLPTokenTransferEvent" }, "fields": [ { @@ -15754,7 +18281,7 @@ const schemaAST = { "kind": "InputObjectTypeDefinition", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_filter" + "value": "SwapLPTokenTransferEvent_filter" }, "fields": [ { @@ -17268,7 +19795,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_filter" + "value": "SwapLPTokenTransferEvent_filter" } } }, @@ -17286,7 +19813,7 @@ const schemaAST = { "kind": "NamedType", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_filter" + "value": "SwapLPTokenTransferEvent_filter" } } }, @@ -17299,7 +19826,7 @@ const schemaAST = { "kind": "EnumTypeDefinition", "name": { "kind": "Name", - "value": "SwapLPTokenTransfer_orderBy" + "value": "SwapLPTokenTransferEvent_orderBy" }, "values": [ { diff --git a/packages/graph-client/.graphclient/sources/Tenderize/schema.graphql b/packages/graph-client/.graphclient/sources/lpEth/schema.graphql similarity index 89% rename from packages/graph-client/.graphclient/sources/Tenderize/schema.graphql rename to packages/graph-client/.graphclient/sources/lpEth/schema.graphql index 22e29a3..d2d5a8e 100644 --- a/packages/graph-client/.graphclient/sources/Tenderize/schema.graphql +++ b/packages/graph-client/.graphclient/sources/lpEth/schema.graphql @@ -545,6 +545,120 @@ enum OrderDirection { desc } +type PreLaunch { + id: ID! + amount: BigInt! + weightedAmount: BigInt! +} + +type PreLaunchPosition { + id: ID! + account: Bytes! + amount: BigInt! + weightedAmount: BigInt! + duration: BigInt! + claimed: Boolean! +} + +input PreLaunchPosition_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + account: Bytes + account_not: Bytes + account_gt: Bytes + account_lt: Bytes + account_gte: Bytes + account_lte: Bytes + account_in: [Bytes!] + account_not_in: [Bytes!] + account_contains: Bytes + account_not_contains: Bytes + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + weightedAmount: BigInt + weightedAmount_not: BigInt + weightedAmount_gt: BigInt + weightedAmount_lt: BigInt + weightedAmount_gte: BigInt + weightedAmount_lte: BigInt + weightedAmount_in: [BigInt!] + weightedAmount_not_in: [BigInt!] + duration: BigInt + duration_not: BigInt + duration_gt: BigInt + duration_lt: BigInt + duration_gte: BigInt + duration_lte: BigInt + duration_in: [BigInt!] + duration_not_in: [BigInt!] + claimed: Boolean + claimed_not: Boolean + claimed_in: [Boolean!] + claimed_not_in: [Boolean!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [PreLaunchPosition_filter] + or: [PreLaunchPosition_filter] +} + +enum PreLaunchPosition_orderBy { + id + account + amount + weightedAmount + duration + claimed +} + +input PreLaunch_filter { + id: ID + id_not: ID + id_gt: ID + id_lt: ID + id_gte: ID + id_lte: ID + id_in: [ID!] + id_not_in: [ID!] + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] + weightedAmount: BigInt + weightedAmount_not: BigInt + weightedAmount_gt: BigInt + weightedAmount_lt: BigInt + weightedAmount_gte: BigInt + weightedAmount_lte: BigInt + weightedAmount_in: [BigInt!] + weightedAmount_not_in: [BigInt!] + """Filter for the block changed event.""" + _change_block: BlockChangedFilter + and: [PreLaunch_filter] + or: [PreLaunch_filter] +} + +enum PreLaunch_orderBy { + id + amount + weightedAmount +} + type Query { batchUnlockBought( id: ID! @@ -832,7 +946,7 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [Withdraw!]! - swapLPTokenTransfer( + swapLPTokenTransferEvent( id: ID! """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. @@ -842,13 +956,13 @@ type Query { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): SwapLPTokenTransfer - swapLPTokenTransfers( + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( skip: Int = 0 first: Int = 100 - orderBy: SwapLPTokenTransfer_orderBy + orderBy: SwapLPTokenTransferEvent_orderBy orderDirection: OrderDirection - where: SwapLPTokenTransfer_filter + where: SwapLPTokenTransferEvent_filter """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. """ @@ -857,7 +971,7 @@ type Query { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): [SwapLPTokenTransfer!]! + ): [SwapLPTokenTransferEvent!]! user( id: ID! """ @@ -910,6 +1024,58 @@ type Query { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [LiquidityPosition!]! + preLaunchPosition( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunchPosition + preLaunchPositions( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunchPosition_orderBy + orderDirection: OrderDirection + where: PreLaunchPosition_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunchPosition!]! + preLaunch( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunch + preLaunches( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunch_orderBy + orderDirection: OrderDirection + where: PreLaunch_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunch!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } @@ -1280,7 +1446,7 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [Withdraw!]! - swapLPTokenTransfer( + swapLPTokenTransferEvent( id: ID! """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. @@ -1290,13 +1456,13 @@ type Subscription { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): SwapLPTokenTransfer - swapLPTokenTransfers( + ): SwapLPTokenTransferEvent + swapLPTokenTransferEvents( skip: Int = 0 first: Int = 100 - orderBy: SwapLPTokenTransfer_orderBy + orderBy: SwapLPTokenTransferEvent_orderBy orderDirection: OrderDirection - where: SwapLPTokenTransfer_filter + where: SwapLPTokenTransferEvent_filter """ The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. """ @@ -1305,7 +1471,7 @@ type Subscription { Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. """ subgraphError: _SubgraphErrorPolicy_! = deny - ): [SwapLPTokenTransfer!]! + ): [SwapLPTokenTransferEvent!]! user( id: ID! """ @@ -1358,6 +1524,58 @@ type Subscription { """ subgraphError: _SubgraphErrorPolicy_! = deny ): [LiquidityPosition!]! + preLaunchPosition( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunchPosition + preLaunchPositions( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunchPosition_orderBy + orderDirection: OrderDirection + where: PreLaunchPosition_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunchPosition!]! + preLaunch( + id: ID! + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): PreLaunch + preLaunches( + skip: Int = 0 + first: Int = 100 + orderBy: PreLaunch_orderBy + orderDirection: OrderDirection + where: PreLaunch_filter + """ + The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted. + """ + block: Block_height + """ + Set to `allow` to receive data even if the subgraph has skipped over errors while syncing. + """ + subgraphError: _SubgraphErrorPolicy_! = deny + ): [PreLaunch!]! """Access to subgraph metadata""" _meta(block: Block_height): _Meta_ } @@ -1376,7 +1594,7 @@ type Swap { transactionHash: Bytes! } -type SwapLPTokenTransfer { +type SwapLPTokenTransferEvent { id: ID! timestamp: Int! blockNumber: BigInt! @@ -1386,7 +1604,7 @@ type SwapLPTokenTransfer { SwapPool: SwapPool! } -input SwapLPTokenTransfer_filter { +input SwapLPTokenTransferEvent_filter { id: ID id_not: ID id_gt: ID @@ -1482,11 +1700,11 @@ input SwapLPTokenTransfer_filter { SwapPool_: SwapPool_filter """Filter for the block changed event.""" _change_block: BlockChangedFilter - and: [SwapLPTokenTransfer_filter] - or: [SwapLPTokenTransfer_filter] + and: [SwapLPTokenTransferEvent_filter] + or: [SwapLPTokenTransferEvent_filter] } -enum SwapLPTokenTransfer_orderBy { +enum SwapLPTokenTransferEvent_orderBy { id timestamp blockNumber diff --git a/packages/graph-client/.graphclient/sources/Tenderize/types.ts b/packages/graph-client/.graphclient/sources/lpEth/types.ts similarity index 90% rename from packages/graph-client/.graphclient/sources/Tenderize/types.ts rename to packages/graph-client/.graphclient/sources/lpEth/types.ts index 55305a5..2bc0fbf 100644 --- a/packages/graph-client/.graphclient/sources/Tenderize/types.ts +++ b/packages/graph-client/.graphclient/sources/lpEth/types.ts @@ -3,7 +3,7 @@ import { InContextSdkMethod } from '@graphql-mesh/types'; import { MeshContext } from '@graphql-mesh/runtime'; -export namespace TenderizeTypes { +export namespace LpEthTypes { export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; @@ -535,6 +535,118 @@ export type OrderDirection = | 'asc' | 'desc'; +export type PreLaunch = { + id: Scalars['ID']['output']; + amount: Scalars['BigInt']['output']; + weightedAmount: Scalars['BigInt']['output']; +}; + +export type PreLaunchPosition = { + id: Scalars['ID']['output']; + account: Scalars['Bytes']['output']; + amount: Scalars['BigInt']['output']; + weightedAmount: Scalars['BigInt']['output']; + duration: Scalars['BigInt']['output']; + claimed: Scalars['Boolean']['output']; +}; + +export type PreLaunchPosition_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + account?: InputMaybe; + account_not?: InputMaybe; + account_gt?: InputMaybe; + account_lt?: InputMaybe; + account_gte?: InputMaybe; + account_lte?: InputMaybe; + account_in?: InputMaybe>; + account_not_in?: InputMaybe>; + account_contains?: InputMaybe; + account_not_contains?: InputMaybe; + amount?: InputMaybe; + amount_not?: InputMaybe; + amount_gt?: InputMaybe; + amount_lt?: InputMaybe; + amount_gte?: InputMaybe; + amount_lte?: InputMaybe; + amount_in?: InputMaybe>; + amount_not_in?: InputMaybe>; + weightedAmount?: InputMaybe; + weightedAmount_not?: InputMaybe; + weightedAmount_gt?: InputMaybe; + weightedAmount_lt?: InputMaybe; + weightedAmount_gte?: InputMaybe; + weightedAmount_lte?: InputMaybe; + weightedAmount_in?: InputMaybe>; + weightedAmount_not_in?: InputMaybe>; + duration?: InputMaybe; + duration_not?: InputMaybe; + duration_gt?: InputMaybe; + duration_lt?: InputMaybe; + duration_gte?: InputMaybe; + duration_lte?: InputMaybe; + duration_in?: InputMaybe>; + duration_not_in?: InputMaybe>; + claimed?: InputMaybe; + claimed_not?: InputMaybe; + claimed_in?: InputMaybe>; + claimed_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type PreLaunchPosition_orderBy = + | 'id' + | 'account' + | 'amount' + | 'weightedAmount' + | 'duration' + | 'claimed'; + +export type PreLaunch_filter = { + id?: InputMaybe; + id_not?: InputMaybe; + id_gt?: InputMaybe; + id_lt?: InputMaybe; + id_gte?: InputMaybe; + id_lte?: InputMaybe; + id_in?: InputMaybe>; + id_not_in?: InputMaybe>; + amount?: InputMaybe; + amount_not?: InputMaybe; + amount_gt?: InputMaybe; + amount_lt?: InputMaybe; + amount_gte?: InputMaybe; + amount_lte?: InputMaybe; + amount_in?: InputMaybe>; + amount_not_in?: InputMaybe>; + weightedAmount?: InputMaybe; + weightedAmount_not?: InputMaybe; + weightedAmount_gt?: InputMaybe; + weightedAmount_lt?: InputMaybe; + weightedAmount_gte?: InputMaybe; + weightedAmount_lte?: InputMaybe; + weightedAmount_in?: InputMaybe>; + weightedAmount_not_in?: InputMaybe>; + /** Filter for the block changed event. */ + _change_block?: InputMaybe; + and?: InputMaybe>>; + or?: InputMaybe>>; +}; + +export type PreLaunch_orderBy = + | 'id' + | 'amount' + | 'weightedAmount'; + export type Query = { batchUnlockBought?: Maybe; batchUnlockBoughts: Array; @@ -558,12 +670,16 @@ export type Query = { unlockRedeemeds: Array; withdraw?: Maybe; withdraws: Array; - swapLPTokenTransfer?: Maybe; - swapLPTokenTransfers: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; user?: Maybe; users: Array; liquidityPosition?: Maybe; liquidityPositions: Array; + preLaunchPosition?: Maybe; + preLaunchPositions: Array; + preLaunch?: Maybe; + preLaunches: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -767,19 +883,19 @@ export type QuerywithdrawsArgs = { }; -export type QueryswapLPTokenTransferArgs = { +export type QueryswapLPTokenTransferEventArgs = { id: Scalars['ID']['input']; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; -export type QueryswapLPTokenTransfersArgs = { +export type QueryswapLPTokenTransferEventsArgs = { skip?: InputMaybe; first?: InputMaybe; - orderBy?: InputMaybe; + orderBy?: InputMaybe; orderDirection?: InputMaybe; - where?: InputMaybe; + where?: InputMaybe; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; @@ -821,6 +937,42 @@ export type QueryliquidityPositionsArgs = { }; +export type QuerypreLaunchPositionArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerypreLaunchPositionsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerypreLaunchArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QuerypreLaunchesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Query_metaArgs = { block?: InputMaybe; }; @@ -926,12 +1078,16 @@ export type Subscription = { unlockRedeemeds: Array; withdraw?: Maybe; withdraws: Array; - swapLPTokenTransfer?: Maybe; - swapLPTokenTransfers: Array; + swapLPTokenTransferEvent?: Maybe; + swapLPTokenTransferEvents: Array; user?: Maybe; users: Array; liquidityPosition?: Maybe; liquidityPositions: Array; + preLaunchPosition?: Maybe; + preLaunchPositions: Array; + preLaunch?: Maybe; + preLaunches: Array; /** Access to subgraph metadata */ _meta?: Maybe<_Meta_>; }; @@ -1135,19 +1291,19 @@ export type SubscriptionwithdrawsArgs = { }; -export type SubscriptionswapLPTokenTransferArgs = { +export type SubscriptionswapLPTokenTransferEventArgs = { id: Scalars['ID']['input']; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; -export type SubscriptionswapLPTokenTransfersArgs = { +export type SubscriptionswapLPTokenTransferEventsArgs = { skip?: InputMaybe; first?: InputMaybe; - orderBy?: InputMaybe; + orderBy?: InputMaybe; orderDirection?: InputMaybe; - where?: InputMaybe; + where?: InputMaybe; block?: InputMaybe; subgraphError?: _SubgraphErrorPolicy_; }; @@ -1189,6 +1345,42 @@ export type SubscriptionliquidityPositionsArgs = { }; +export type SubscriptionpreLaunchPositionArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionpreLaunchPositionsArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionpreLaunchArgs = { + id: Scalars['ID']['input']; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionpreLaunchesArgs = { + skip?: InputMaybe; + first?: InputMaybe; + orderBy?: InputMaybe; + orderDirection?: InputMaybe; + where?: InputMaybe; + block?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; +}; + + export type Subscription_metaArgs = { block?: InputMaybe; }; @@ -1207,7 +1399,7 @@ export type Swap = { transactionHash: Scalars['Bytes']['output']; }; -export type SwapLPTokenTransfer = { +export type SwapLPTokenTransferEvent = { id: Scalars['ID']['output']; timestamp: Scalars['Int']['output']; blockNumber: Scalars['BigInt']['output']; @@ -1217,7 +1409,7 @@ export type SwapLPTokenTransfer = { SwapPool: SwapPool; }; -export type SwapLPTokenTransfer_filter = { +export type SwapLPTokenTransferEvent_filter = { id?: InputMaybe; id_not?: InputMaybe; id_gt?: InputMaybe; @@ -1313,11 +1505,11 @@ export type SwapLPTokenTransfer_filter = { SwapPool_?: InputMaybe; /** Filter for the block changed event. */ _change_block?: InputMaybe; - and?: InputMaybe>>; - or?: InputMaybe>>; + and?: InputMaybe>>; + or?: InputMaybe>>; }; -export type SwapLPTokenTransfer_orderBy = +export type SwapLPTokenTransferEvent_orderBy = | 'id' | 'timestamp' | 'blockNumber' @@ -2253,9 +2445,9 @@ export type _SubgraphErrorPolicy_ = /** null **/ withdraws: InContextSdkMethod, /** null **/ - swapLPTokenTransfer: InContextSdkMethod, + swapLPTokenTransferEvent: InContextSdkMethod, /** null **/ - swapLPTokenTransfers: InContextSdkMethod, + swapLPTokenTransferEvents: InContextSdkMethod, /** null **/ user: InContextSdkMethod, /** null **/ @@ -2264,6 +2456,14 @@ export type _SubgraphErrorPolicy_ = liquidityPosition: InContextSdkMethod, /** null **/ liquidityPositions: InContextSdkMethod, + /** null **/ + preLaunchPosition: InContextSdkMethod, + /** null **/ + preLaunchPositions: InContextSdkMethod, + /** null **/ + preLaunch: InContextSdkMethod, + /** null **/ + preLaunches: InContextSdkMethod, /** Access to subgraph metadata **/ _meta: InContextSdkMethod }; @@ -2318,9 +2518,9 @@ export type _SubgraphErrorPolicy_ = /** null **/ withdraws: InContextSdkMethod, /** null **/ - swapLPTokenTransfer: InContextSdkMethod, + swapLPTokenTransferEvent: InContextSdkMethod, /** null **/ - swapLPTokenTransfers: InContextSdkMethod, + swapLPTokenTransferEvents: InContextSdkMethod, /** null **/ user: InContextSdkMethod, /** null **/ @@ -2329,12 +2529,20 @@ export type _SubgraphErrorPolicy_ = liquidityPosition: InContextSdkMethod, /** null **/ liquidityPositions: InContextSdkMethod, + /** null **/ + preLaunchPosition: InContextSdkMethod, + /** null **/ + preLaunchPositions: InContextSdkMethod, + /** null **/ + preLaunch: InContextSdkMethod, + /** null **/ + preLaunches: InContextSdkMethod, /** Access to subgraph metadata **/ _meta: InContextSdkMethod }; export type Context = { - ["Tenderize"]: { Query: QuerySdk, Mutation: MutationSdk, Subscription: SubscriptionSdk }, + ["lpEth"]: { Query: QuerySdk, Mutation: MutationSdk, Subscription: SubscriptionSdk }, }; } diff --git a/packages/graph-client/.graphclientrc.yaml b/packages/graph-client/.graphclientrc.yaml new file mode 100644 index 0000000..bfb6305 --- /dev/null +++ b/packages/graph-client/.graphclientrc.yaml @@ -0,0 +1,5 @@ +sources: + - name: Tenderize + handler: + graphql: + endpoint: "https://api.studio.thegraph.com/query/93675/tenderize-v2-arbitrum/version/latest" diff --git a/packages/graph-client/.graphclientrc.yml b/packages/graph-client/.graphclientrc.yml deleted file mode 100644 index b9b2606..0000000 --- a/packages/graph-client/.graphclientrc.yml +++ /dev/null @@ -1,9 +0,0 @@ -sources: - - name: Tenderize - handler: - graphql: - endpoint: "https://api.studio.thegraph.com/query/93675/lpeth/version/latest" -documents: - - ./gql/**/*.gql - - # TODO: replace the END point with ethsubraph url :) diff --git a/packages/graph-client/.prettierignore b/packages/graph-client/.prettierignore new file mode 100644 index 0000000..e6c8309 --- /dev/null +++ b/packages/graph-client/.prettierignore @@ -0,0 +1 @@ +.graphclient \ No newline at end of file diff --git a/packages/graph-client/gql/Pool.gql b/packages/graph-client/gql/Pool.gql deleted file mode 100644 index e3ec438..0000000 --- a/packages/graph-client/gql/Pool.gql +++ /dev/null @@ -1,75 +0,0 @@ -query getPools($dateFilter: Int = 0, $first: Int = 1000, $skip: Int = 0) { - swapPools { - id - lpToken - - liabilities - totalSupply - unlocking - - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - - poolDays( - where: { date_gte: $dateFilter } - orderBy: date - orderDirection: desc - ) { - date - id - - liabilities - totalSupply - unlocking - - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - } - } -} - -query getPool($id: ID!, $dateFilter: Int = 0) { - swapPool(id: $id) { - id - lpToken - - liabilities - totalSupply - unlocking - - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - - poolDays( - where: { date_gte: $dateFilter } - orderBy: date - orderDirection: desc - ) { - date - id - - liabilities - totalSupply - unlocking - - volume - volumeUSD - fees - feesUSD - lpRewards - lpRewardsUSD - } - } -} diff --git a/packages/graph-client/index.ts b/packages/graph-client/index.ts deleted file mode 100644 index f67b2c6..0000000 --- a/packages/graph-client/index.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello via Bun!"); \ No newline at end of file diff --git a/packages/graph-client/package.json b/packages/graph-client/package.json index e8f758b..13778a1 100644 --- a/packages/graph-client/package.json +++ b/packages/graph-client/package.json @@ -1,24 +1,41 @@ { "name": "graph-client", - "module": "index.ts", - "type": "module", + "author": "Tenderize Labs Ltd", + "license": "MIT", + "dependencies": { + "@graphprotocol/client-cli": "^3.0.0", + "@graphql-mesh/cache-localforage": "0.94.1", + "@graphql-mesh/cross-helpers": "0.4.0", + "@graphql-mesh/graphql": "0.94.2", + "@graphql-mesh/http": "0.94.4", + "@graphql-mesh/merger-stitching": "0.94.1", + "@graphql-mesh/runtime": "0.94.1", + "@graphql-mesh/store": "0.94.1", + "@graphql-mesh/transform-filter-schema": "0.94.1", + "@graphql-mesh/transform-prefix": "0.94.2", + "@graphql-mesh/transform-prune": "0.94.1", + "@graphql-mesh/transform-rename": "0.94.2", + "@graphql-mesh/transform-type-merging": "0.94.1", + "@graphql-mesh/types": "0.94.1", + "@graphql-mesh/utils": "0.94.1", + "@graphql-tools/merge": "9.0.0" + }, + "main": "index.js", "devDependencies": { - "@types/bun": "latest" + "@types/node": "^20.3.3", + "@typescript-eslint/eslint-plugin": "^5.59.11", + "@typescript-eslint/parser": "^5.59.11", + "eslint": "^8.42.0", + "eslint-config-prettier": "^8.8.0", + "prettier": "^2.8.8", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" }, "scripts": { - "start": "ts-node index.ts --transpileOnly", - "build": "graphclient build && tsc", - "codegen": "graphclient build", - "dev": "graphclient serve-dev", - "prettier:check": "prettier --check \"**/*.{ts,md,yaml,gql}\"", - "prettier:write": "prettier --write \"**/*.{ts,md,yaml,gql}\"" - }, - "peerDependencies": { - "typescript": "^5.6.3" - }, - "dependencies": { - "@graphprotocol/client-cli": "^3.0.7", - "@types/node": "^22.9.0", - "ts-node": "^10.9.2" + "build": "graphclient build && tsc", + "codegen": "graphclient build", + "dev": "graphclient serve-dev", + "prettier:check": "prettier --check \"**/*.{ts,md,yaml,gql}\"", + "prettier:write": "prettier --write \"**/*.{ts,md,yaml,gql}\"" } } \ No newline at end of file diff --git a/packages/graph-client/tsconfig.json b/packages/graph-client/tsconfig.json index 238655f..a7085fe 100644 --- a/packages/graph-client/tsconfig.json +++ b/packages/graph-client/tsconfig.json @@ -1,27 +1,10 @@ { "compilerOptions": { - // Enable latest features - "lib": ["ESNext", "DOM"], - "target": "ESNext", - "module": "ESNext", - "moduleDetection": "force", - "jsx": "react-jsx", - "allowJs": true, - - // Bundler mode - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "verbatimModuleSyntax": true, - "noEmit": true, - - // Best practices - "strict": true, - "skipLibCheck": true, - "noFallthroughCasesInSwitch": true, - - // Some stricter flags (disabled by default) - "noUnusedLocals": false, - "noUnusedParameters": false, - "noPropertyAccessFromIndexSignature": false + "target": "ES6", + "module": "NodeNext", + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true } -} +} \ No newline at end of file diff --git a/packages/subgraph/.eslintrc b/packages/subgraph/.eslintrc new file mode 100644 index 0000000..113f303 --- /dev/null +++ b/packages/subgraph/.eslintrc @@ -0,0 +1,11 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "extends": [ + "plugin:@typescript-eslint/recommended", + "prettier", + "prettier/@typescript-eslint" + ] +} \ No newline at end of file diff --git a/packages/subgraph/.prettierignore b/packages/subgraph/.prettierignore new file mode 100644 index 0000000..97b5117 --- /dev/null +++ b/packages/subgraph/.prettierignore @@ -0,0 +1,4 @@ +src/types +generated +build +abis \ No newline at end of file diff --git a/packages/subgraph/.prettierrc b/packages/subgraph/.prettierrc new file mode 100644 index 0000000..d9e642c --- /dev/null +++ b/packages/subgraph/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 120 +} \ No newline at end of file diff --git a/packages/subgraph/abis/Prelaunch.json b/packages/subgraph/abis/Prelaunch.json new file mode 100644 index 0000000..812b2eb --- /dev/null +++ b/packages/subgraph/abis/Prelaunch.json @@ -0,0 +1 @@ +[{ "inputs": [{ "components": [{ "internalType": "uint256", "name": "cap", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint256", "name": "minLockup", "type": "uint256" }, { "internalType": "uint256", "name": "maxLockup", "type": "uint256" }, { "internalType": "uint256", "name": "epochLength", "type": "uint256" }, { "internalType": "UD60x18", "name": "minMultiplier", "type": "uint256" }, { "internalType": "UD60x18", "name": "maxMultiplier", "type": "uint256" }, { "internalType": "UD60x18", "name": "slope", "type": "uint256" }], "internalType": "struct Config", "name": "_config", "type": "tuple" }], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "CapExceeded", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "FailedInnerCall", "type": "error" }, { "inputs": [], "name": "Inactive", "type": "error" }, { "inputs": [], "name": "InvalidDuration", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotClaimable", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "x", "type": "uint256" }, { "internalType": "uint256", "name": "y", "type": "uint256" }], "name": "PRBMath_MulDiv18_Overflow", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "x", "type": "uint256" }, { "internalType": "uint256", "name": "y", "type": "uint256" }, { "internalType": "uint256", "name": "denominator", "type": "uint256" }], "name": "PRBMath_MulDiv_Overflow", "type": "error" }, { "inputs": [{ "internalType": "UD60x18", "name": "x", "type": "uint256" }], "name": "PRBMath_UD60x18_Exp2_InputTooBig", "type": "error" }, { "inputs": [{ "internalType": "UD60x18", "name": "x", "type": "uint256" }], "name": "PRBMath_UD60x18_Log_InputTooSmall", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint256", "name": "epochs", "type": "uint256" }], "name": "calculateWeightedDeposit", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "cap", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "duration", "type": "uint256" }], "name": "changeLockup", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "claimVeTokens", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "claimableTimestamp", "outputs": [{ "internalType": "uint96", "name": "", "type": "uint96" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "deadline", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "duration", "type": "uint256" }], "name": "depositETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint256", "name": "duration", "type": "uint256" }], "name": "depositWETH", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "isActive", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "isClaimable", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "lockup", "outputs": [{ "components": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint256", "name": "duration", "type": "uint256" }], "internalType": "struct Lockup", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "minLpShares", "type": "uint256" }], "name": "mintLpEth", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "_lpEth", "type": "address" }], "name": "setLpEth", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "_votingEscrow", "type": "address" }], "name": "setVotingEscrow", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "totalDeposits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalWeightedDeposits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "votingEscrow", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "stateMutability": "payable", "type": "receive" }] \ No newline at end of file diff --git a/packages/subgraph/generated/PreLaunch/PreLaunch.ts b/packages/subgraph/generated/PreLaunch/PreLaunch.ts new file mode 100644 index 0000000..b25cb8a --- /dev/null +++ b/packages/subgraph/generated/PreLaunch/PreLaunch.ts @@ -0,0 +1,761 @@ +// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + +import { + ethereum, + JSONValue, + TypedMap, + Entity, + Bytes, + Address, + BigInt, +} from "@graphprotocol/graph-ts"; + +export class Initialized extends ethereum.Event { + get params(): Initialized__Params { + return new Initialized__Params(this); + } +} + +export class Initialized__Params { + _event: Initialized; + + constructor(event: Initialized) { + this._event = event; + } + + get version(): BigInt { + return this._event.parameters[0].value.toBigInt(); + } +} + +export class OwnershipTransferred extends ethereum.Event { + get params(): OwnershipTransferred__Params { + return new OwnershipTransferred__Params(this); + } +} + +export class OwnershipTransferred__Params { + _event: OwnershipTransferred; + + constructor(event: OwnershipTransferred) { + this._event = event; + } + + get previousOwner(): Address { + return this._event.parameters[0].value.toAddress(); + } + + get newOwner(): Address { + return this._event.parameters[1].value.toAddress(); + } +} + +export class Upgraded extends ethereum.Event { + get params(): Upgraded__Params { + return new Upgraded__Params(this); + } +} + +export class Upgraded__Params { + _event: Upgraded; + + constructor(event: Upgraded) { + this._event = event; + } + + get implementation(): Address { + return this._event.parameters[0].value.toAddress(); + } +} + +export class PreLaunch__lockupResultValue0Struct extends ethereum.Tuple { + get amount(): BigInt { + return this[0].toBigInt(); + } + + get duration(): BigInt { + return this[1].toBigInt(); + } +} + +export class PreLaunch extends ethereum.SmartContract { + static bind(address: Address): PreLaunch { + return new PreLaunch("PreLaunch", address); + } + + UPGRADE_INTERFACE_VERSION(): string { + let result = super.call( + "UPGRADE_INTERFACE_VERSION", + "UPGRADE_INTERFACE_VERSION():(string)", + [], + ); + + return result[0].toString(); + } + + try_UPGRADE_INTERFACE_VERSION(): ethereum.CallResult { + let result = super.tryCall( + "UPGRADE_INTERFACE_VERSION", + "UPGRADE_INTERFACE_VERSION():(string)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toString()); + } + + calculateWeightedDeposit(amount: BigInt, epochs: BigInt): BigInt { + let result = super.call( + "calculateWeightedDeposit", + "calculateWeightedDeposit(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(amount), + ethereum.Value.fromUnsignedBigInt(epochs), + ], + ); + + return result[0].toBigInt(); + } + + try_calculateWeightedDeposit( + amount: BigInt, + epochs: BigInt, + ): ethereum.CallResult { + let result = super.tryCall( + "calculateWeightedDeposit", + "calculateWeightedDeposit(uint256,uint256):(uint256)", + [ + ethereum.Value.fromUnsignedBigInt(amount), + ethereum.Value.fromUnsignedBigInt(epochs), + ], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + cap(): BigInt { + let result = super.call("cap", "cap():(uint256)", []); + + return result[0].toBigInt(); + } + + try_cap(): ethereum.CallResult { + let result = super.tryCall("cap", "cap():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + claimableTimestamp(): BigInt { + let result = super.call( + "claimableTimestamp", + "claimableTimestamp():(uint96)", + [], + ); + + return result[0].toBigInt(); + } + + try_claimableTimestamp(): ethereum.CallResult { + let result = super.tryCall( + "claimableTimestamp", + "claimableTimestamp():(uint96)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + deadline(): BigInt { + let result = super.call("deadline", "deadline():(uint256)", []); + + return result[0].toBigInt(); + } + + try_deadline(): ethereum.CallResult { + let result = super.tryCall("deadline", "deadline():(uint256)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + isActive(): boolean { + let result = super.call("isActive", "isActive():(bool)", []); + + return result[0].toBoolean(); + } + + try_isActive(): ethereum.CallResult { + let result = super.tryCall("isActive", "isActive():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + isClaimable(): boolean { + let result = super.call("isClaimable", "isClaimable():(bool)", []); + + return result[0].toBoolean(); + } + + try_isClaimable(): ethereum.CallResult { + let result = super.tryCall("isClaimable", "isClaimable():(bool)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBoolean()); + } + + lockup(account: Address): PreLaunch__lockupResultValue0Struct { + let result = super.call("lockup", "lockup(address):((uint256,uint256))", [ + ethereum.Value.fromAddress(account), + ]); + + return changetype(result[0].toTuple()); + } + + try_lockup( + account: Address, + ): ethereum.CallResult { + let result = super.tryCall( + "lockup", + "lockup(address):((uint256,uint256))", + [ethereum.Value.fromAddress(account)], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue( + changetype(value[0].toTuple()), + ); + } + + owner(): Address { + let result = super.call("owner", "owner():(address)", []); + + return result[0].toAddress(); + } + + try_owner(): ethereum.CallResult
{ + let result = super.tryCall("owner", "owner():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } + + proxiableUUID(): Bytes { + let result = super.call("proxiableUUID", "proxiableUUID():(bytes32)", []); + + return result[0].toBytes(); + } + + try_proxiableUUID(): ethereum.CallResult { + let result = super.tryCall( + "proxiableUUID", + "proxiableUUID():(bytes32)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBytes()); + } + + totalDeposits(): BigInt { + let result = super.call("totalDeposits", "totalDeposits():(uint256)", []); + + return result[0].toBigInt(); + } + + try_totalDeposits(): ethereum.CallResult { + let result = super.tryCall( + "totalDeposits", + "totalDeposits():(uint256)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + totalWeightedDeposits(): BigInt { + let result = super.call( + "totalWeightedDeposits", + "totalWeightedDeposits():(uint256)", + [], + ); + + return result[0].toBigInt(); + } + + try_totalWeightedDeposits(): ethereum.CallResult { + let result = super.tryCall( + "totalWeightedDeposits", + "totalWeightedDeposits():(uint256)", + [], + ); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toBigInt()); + } + + votingEscrow(): Address { + let result = super.call("votingEscrow", "votingEscrow():(address)", []); + + return result[0].toAddress(); + } + + try_votingEscrow(): ethereum.CallResult
{ + let result = super.tryCall("votingEscrow", "votingEscrow():(address)", []); + if (result.reverted) { + return new ethereum.CallResult(); + } + let value = result.value; + return ethereum.CallResult.fromValue(value[0].toAddress()); + } +} + +export class ConstructorCall extends ethereum.Call { + get inputs(): ConstructorCall__Inputs { + return new ConstructorCall__Inputs(this); + } + + get outputs(): ConstructorCall__Outputs { + return new ConstructorCall__Outputs(this); + } +} + +export class ConstructorCall__Inputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } + + get _config(): ConstructorCall_configStruct { + return changetype( + this._call.inputValues[0].value.toTuple(), + ); + } +} + +export class ConstructorCall__Outputs { + _call: ConstructorCall; + + constructor(call: ConstructorCall) { + this._call = call; + } +} + +export class ConstructorCall_configStruct extends ethereum.Tuple { + get cap(): BigInt { + return this[0].toBigInt(); + } + + get deadline(): BigInt { + return this[1].toBigInt(); + } + + get minLockup(): BigInt { + return this[2].toBigInt(); + } + + get maxLockup(): BigInt { + return this[3].toBigInt(); + } + + get epochLength(): BigInt { + return this[4].toBigInt(); + } + + get minMultiplier(): BigInt { + return this[5].toBigInt(); + } + + get maxMultiplier(): BigInt { + return this[6].toBigInt(); + } + + get slope(): BigInt { + return this[7].toBigInt(); + } +} + +export class ChangeLockupCall extends ethereum.Call { + get inputs(): ChangeLockupCall__Inputs { + return new ChangeLockupCall__Inputs(this); + } + + get outputs(): ChangeLockupCall__Outputs { + return new ChangeLockupCall__Outputs(this); + } +} + +export class ChangeLockupCall__Inputs { + _call: ChangeLockupCall; + + constructor(call: ChangeLockupCall) { + this._call = call; + } + + get duration(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class ChangeLockupCall__Outputs { + _call: ChangeLockupCall; + + constructor(call: ChangeLockupCall) { + this._call = call; + } +} + +export class ClaimVeTokensCall extends ethereum.Call { + get inputs(): ClaimVeTokensCall__Inputs { + return new ClaimVeTokensCall__Inputs(this); + } + + get outputs(): ClaimVeTokensCall__Outputs { + return new ClaimVeTokensCall__Outputs(this); + } +} + +export class ClaimVeTokensCall__Inputs { + _call: ClaimVeTokensCall; + + constructor(call: ClaimVeTokensCall) { + this._call = call; + } +} + +export class ClaimVeTokensCall__Outputs { + _call: ClaimVeTokensCall; + + constructor(call: ClaimVeTokensCall) { + this._call = call; + } +} + +export class DepositETHCall extends ethereum.Call { + get inputs(): DepositETHCall__Inputs { + return new DepositETHCall__Inputs(this); + } + + get outputs(): DepositETHCall__Outputs { + return new DepositETHCall__Outputs(this); + } +} + +export class DepositETHCall__Inputs { + _call: DepositETHCall; + + constructor(call: DepositETHCall) { + this._call = call; + } + + get duration(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class DepositETHCall__Outputs { + _call: DepositETHCall; + + constructor(call: DepositETHCall) { + this._call = call; + } +} + +export class DepositWETHCall extends ethereum.Call { + get inputs(): DepositWETHCall__Inputs { + return new DepositWETHCall__Inputs(this); + } + + get outputs(): DepositWETHCall__Outputs { + return new DepositWETHCall__Outputs(this); + } +} + +export class DepositWETHCall__Inputs { + _call: DepositWETHCall; + + constructor(call: DepositWETHCall) { + this._call = call; + } + + get amount(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } + + get duration(): BigInt { + return this._call.inputValues[1].value.toBigInt(); + } +} + +export class DepositWETHCall__Outputs { + _call: DepositWETHCall; + + constructor(call: DepositWETHCall) { + this._call = call; + } +} + +export class InitializeCall extends ethereum.Call { + get inputs(): InitializeCall__Inputs { + return new InitializeCall__Inputs(this); + } + + get outputs(): InitializeCall__Outputs { + return new InitializeCall__Outputs(this); + } +} + +export class InitializeCall__Inputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } +} + +export class InitializeCall__Outputs { + _call: InitializeCall; + + constructor(call: InitializeCall) { + this._call = call; + } +} + +export class MintLpEthCall extends ethereum.Call { + get inputs(): MintLpEthCall__Inputs { + return new MintLpEthCall__Inputs(this); + } + + get outputs(): MintLpEthCall__Outputs { + return new MintLpEthCall__Outputs(this); + } +} + +export class MintLpEthCall__Inputs { + _call: MintLpEthCall; + + constructor(call: MintLpEthCall) { + this._call = call; + } + + get minLpShares(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class MintLpEthCall__Outputs { + _call: MintLpEthCall; + + constructor(call: MintLpEthCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall extends ethereum.Call { + get inputs(): RenounceOwnershipCall__Inputs { + return new RenounceOwnershipCall__Inputs(this); + } + + get outputs(): RenounceOwnershipCall__Outputs { + return new RenounceOwnershipCall__Outputs(this); + } +} + +export class RenounceOwnershipCall__Inputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class RenounceOwnershipCall__Outputs { + _call: RenounceOwnershipCall; + + constructor(call: RenounceOwnershipCall) { + this._call = call; + } +} + +export class SetLpEthCall extends ethereum.Call { + get inputs(): SetLpEthCall__Inputs { + return new SetLpEthCall__Inputs(this); + } + + get outputs(): SetLpEthCall__Outputs { + return new SetLpEthCall__Outputs(this); + } +} + +export class SetLpEthCall__Inputs { + _call: SetLpEthCall; + + constructor(call: SetLpEthCall) { + this._call = call; + } + + get _lpEth(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetLpEthCall__Outputs { + _call: SetLpEthCall; + + constructor(call: SetLpEthCall) { + this._call = call; + } +} + +export class SetVotingEscrowCall extends ethereum.Call { + get inputs(): SetVotingEscrowCall__Inputs { + return new SetVotingEscrowCall__Inputs(this); + } + + get outputs(): SetVotingEscrowCall__Outputs { + return new SetVotingEscrowCall__Outputs(this); + } +} + +export class SetVotingEscrowCall__Inputs { + _call: SetVotingEscrowCall; + + constructor(call: SetVotingEscrowCall) { + this._call = call; + } + + get _votingEscrow(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class SetVotingEscrowCall__Outputs { + _call: SetVotingEscrowCall; + + constructor(call: SetVotingEscrowCall) { + this._call = call; + } +} + +export class TransferOwnershipCall extends ethereum.Call { + get inputs(): TransferOwnershipCall__Inputs { + return new TransferOwnershipCall__Inputs(this); + } + + get outputs(): TransferOwnershipCall__Outputs { + return new TransferOwnershipCall__Outputs(this); + } +} + +export class TransferOwnershipCall__Inputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } + + get newOwner(): Address { + return this._call.inputValues[0].value.toAddress(); + } +} + +export class TransferOwnershipCall__Outputs { + _call: TransferOwnershipCall; + + constructor(call: TransferOwnershipCall) { + this._call = call; + } +} + +export class UpgradeToAndCallCall extends ethereum.Call { + get inputs(): UpgradeToAndCallCall__Inputs { + return new UpgradeToAndCallCall__Inputs(this); + } + + get outputs(): UpgradeToAndCallCall__Outputs { + return new UpgradeToAndCallCall__Outputs(this); + } +} + +export class UpgradeToAndCallCall__Inputs { + _call: UpgradeToAndCallCall; + + constructor(call: UpgradeToAndCallCall) { + this._call = call; + } + + get newImplementation(): Address { + return this._call.inputValues[0].value.toAddress(); + } + + get data(): Bytes { + return this._call.inputValues[1].value.toBytes(); + } +} + +export class UpgradeToAndCallCall__Outputs { + _call: UpgradeToAndCallCall; + + constructor(call: UpgradeToAndCallCall) { + this._call = call; + } +} + +export class WithdrawCall extends ethereum.Call { + get inputs(): WithdrawCall__Inputs { + return new WithdrawCall__Inputs(this); + } + + get outputs(): WithdrawCall__Outputs { + return new WithdrawCall__Outputs(this); + } +} + +export class WithdrawCall__Inputs { + _call: WithdrawCall; + + constructor(call: WithdrawCall) { + this._call = call; + } + + get amount(): BigInt { + return this._call.inputValues[0].value.toBigInt(); + } +} + +export class WithdrawCall__Outputs { + _call: WithdrawCall; + + constructor(call: WithdrawCall) { + this._call = call; + } +} diff --git a/packages/subgraph/generated/schema.ts b/packages/subgraph/generated/schema.ts index 5cddefc..fb5dcdd 100644 --- a/packages/subgraph/generated/schema.ts +++ b/packages/subgraph/generated/schema.ts @@ -1688,7 +1688,7 @@ export class Withdraw extends Entity { } } -export class SwapLPTokenTransfer extends Entity { +export class SwapLPTokenTransferEvent extends Entity { constructor(id: string) { super(); this.set("id", Value.fromString(id)); @@ -1696,25 +1696,28 @@ export class SwapLPTokenTransfer extends Entity { save(): void { let id = this.get("id"); - assert(id != null, "Cannot save SwapLPTokenTransfer entity without an ID"); + assert( + id != null, + "Cannot save SwapLPTokenTransferEvent entity without an ID", + ); if (id) { assert( id.kind == ValueKind.STRING, - `Entities of type SwapLPTokenTransfer must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, + `Entities of type SwapLPTokenTransferEvent must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, ); - store.set("SwapLPTokenTransfer", id.toString(), this); + store.set("SwapLPTokenTransferEvent", id.toString(), this); } } - static loadInBlock(id: string): SwapLPTokenTransfer | null { - return changetype( - store.get_in_block("SwapLPTokenTransfer", id), + static loadInBlock(id: string): SwapLPTokenTransferEvent | null { + return changetype( + store.get_in_block("SwapLPTokenTransferEvent", id), ); } - static load(id: string): SwapLPTokenTransfer | null { - return changetype( - store.get("SwapLPTokenTransfer", id), + static load(id: string): SwapLPTokenTransferEvent | null { + return changetype( + store.get("SwapLPTokenTransferEvent", id), ); } @@ -1783,8 +1786,8 @@ export class SwapLPTokenTransfer extends Entity { this.set("to", Value.fromString(value)); } - get amount(): BigInt { - let value = this.get("amount"); + get shares(): BigInt { + let value = this.get("shares"); if (!value || value.kind == ValueKind.NULL) { throw new Error("Cannot return null for a required field."); } else { @@ -1792,8 +1795,21 @@ export class SwapLPTokenTransfer extends Entity { } } - set amount(value: BigInt) { - this.set("amount", Value.fromBigInt(value)); + set shares(value: BigInt) { + this.set("shares", Value.fromBigInt(value)); + } + + get value(): BigInt { + let value = this.get("value"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set value(value: BigInt) { + this.set("value", Value.fromBigInt(value)); } get SwapPool(): string { @@ -1954,6 +1970,198 @@ export class LiquidityPosition extends Entity { } } +export class PreLaunchPosition extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PreLaunchPosition entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type PreLaunchPosition must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("PreLaunchPosition", id.toString(), this); + } + } + + static loadInBlock(id: string): PreLaunchPosition | null { + return changetype( + store.get_in_block("PreLaunchPosition", id), + ); + } + + static load(id: string): PreLaunchPosition | null { + return changetype( + store.get("PreLaunchPosition", id), + ); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get account(): Bytes { + let value = this.get("account"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBytes(); + } + } + + set account(value: Bytes) { + this.set("account", Value.fromBytes(value)); + } + + get amount(): BigInt { + let value = this.get("amount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set amount(value: BigInt) { + this.set("amount", Value.fromBigInt(value)); + } + + get weightedAmount(): BigInt { + let value = this.get("weightedAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set weightedAmount(value: BigInt) { + this.set("weightedAmount", Value.fromBigInt(value)); + } + + get duration(): BigInt { + let value = this.get("duration"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set duration(value: BigInt) { + this.set("duration", Value.fromBigInt(value)); + } + + get claimed(): boolean { + let value = this.get("claimed"); + if (!value || value.kind == ValueKind.NULL) { + return false; + } else { + return value.toBoolean(); + } + } + + set claimed(value: boolean) { + this.set("claimed", Value.fromBoolean(value)); + } + + get claimedAt(): BigInt | null { + let value = this.get("claimedAt"); + if (!value || value.kind == ValueKind.NULL) { + return null; + } else { + return value.toBigInt(); + } + } + + set claimedAt(value: BigInt | null) { + if (!value) { + this.unset("claimedAt"); + } else { + this.set("claimedAt", Value.fromBigInt(value)); + } + } +} + +export class PreLaunch extends Entity { + constructor(id: string) { + super(); + this.set("id", Value.fromString(id)); + } + + save(): void { + let id = this.get("id"); + assert(id != null, "Cannot save PreLaunch entity without an ID"); + if (id) { + assert( + id.kind == ValueKind.STRING, + `Entities of type PreLaunch must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, + ); + store.set("PreLaunch", id.toString(), this); + } + } + + static loadInBlock(id: string): PreLaunch | null { + return changetype(store.get_in_block("PreLaunch", id)); + } + + static load(id: string): PreLaunch | null { + return changetype(store.get("PreLaunch", id)); + } + + get id(): string { + let value = this.get("id"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toString(); + } + } + + set id(value: string) { + this.set("id", Value.fromString(value)); + } + + get amount(): BigInt { + let value = this.get("amount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set amount(value: BigInt) { + this.set("amount", Value.fromBigInt(value)); + } + + get weightedAmount(): BigInt { + let value = this.get("weightedAmount"); + if (!value || value.kind == ValueKind.NULL) { + throw new Error("Cannot return null for a required field."); + } else { + return value.toBigInt(); + } + } + + set weightedAmount(value: BigInt) { + this.set("weightedAmount", Value.fromBigInt(value)); + } +} + export class SwapPoolDayLoader extends Entity { _entity: string; _field: string; diff --git a/packages/subgraph/package.json b/packages/subgraph/package.json index c51c06a..d7d6df1 100644 --- a/packages/subgraph/package.json +++ b/packages/subgraph/package.json @@ -2,6 +2,8 @@ "name": "lpeth-subgraph", "license": "UNLICENSED", "scripts": { + "prettier:check": "prettier --check \"**/*.{ts,md,graphql}\"", + "prettier:write": "prettier --write \"**/*.{ts,md,graphql}\"", "clean" : "rm -rf build", "auth": "graph auth", "codegen": "graph codegen", @@ -17,6 +19,13 @@ "@graphprotocol/graph-ts": "0.32.0" }, "devDependencies": { - "matchstick-as": "0.5.0" + "matchstick-as": "0.5.0", + "prettier": "^2.8.8", + "typescript": "^5.1.3", + "@types/node": "^20.3.1", + "@typescript-eslint/eslint-plugin": "^5.59.11", + "@typescript-eslint/parser": "^5.59.11", + "eslint": "^8.42.0", + "eslint-config-prettier": "^8.8.0" } } \ No newline at end of file diff --git a/packages/subgraph/schema.graphql b/packages/subgraph/schema.graphql index 70ede0b..a66da12 100644 --- a/packages/subgraph/schema.graphql +++ b/packages/subgraph/schema.graphql @@ -139,14 +139,15 @@ type Withdraw @entity(immutable: true) { transactionHash: Bytes! } -type SwapLPTokenTransfer @entity(immutable: true) { +type SwapLPTokenTransferEvent @entity(immutable: true) { id: ID! timestamp: Int! blockNumber: BigInt! from: String! to: String! - amount: BigInt! + shares: BigInt! + value: BigInt! # Relational fields SwapPool: SwapPool! @@ -164,3 +165,19 @@ type LiquidityPosition @entity { shares: BigInt! netDeposits: BigInt! } + +type PreLaunchPosition @entity { + id: ID! # user address + account: Bytes! # user address + amount: BigInt! + weightedAmount: BigInt! + duration: BigInt! + claimed: Boolean! + claimedAt: BigInt +} + +type PreLaunch @entity { + id: ID! # contract address + amount: BigInt! + weightedAmount: BigInt! +} diff --git a/packages/subgraph/src/mappings/helpers.ts b/packages/subgraph/src/mappings/helpers.ts index 21cd734..d7f1062 100644 --- a/packages/subgraph/src/mappings/helpers.ts +++ b/packages/subgraph/src/mappings/helpers.ts @@ -1,46 +1,27 @@ -import { - Address, - BigDecimal, - BigInt, - Bytes, - ethereum, -} from "@graphprotocol/graph-ts"; -import { UniswapQuoter } from "../../generated/LpETH/UniswapQuoter"; -import { SwapPool, SwapPoolDay } from "../../generated/schema"; - -export const ADDRESS_ZERO = Address.fromString( - "0x0000000000000000000000000000000000000000" -); - -export const BD_ZERO = BigDecimal.fromString("0"); -export const BI_ZERO = BigInt.fromI32(0); -export const BI_ONE = BigInt.fromI32(1); -export const BD_ONE = BigDecimal.fromString("1"); -export const BI_18 = BigInt.fromI32(18); -export const TEN_18 = BigInt.fromU32(10).pow(18); -export const TEN_6 = BigInt.fromU32(10).pow(6); -export const TEN_24 = TEN_18.times(TEN_6); // 18 decimals for normal tokens and 6 decimals for USDC - -export const QUOTER = Address.fromString( - "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6" -); -export const WETH9_ARBITRUM = Address.fromString( - "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" -); -export const USDC_ARBITRUM = Address.fromString( - "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" -); -export const USDC_MAINNET = Address.fromString( - "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" -); -export const WETH_MAINNET = Address.fromString( - "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" -); -const REBASE_TOPIC = - "0x11c6bf55864ff83827df712625d7a80e5583eef0264921025e7cd22003a21511"; +import { Address, BigDecimal, BigInt, Bytes, ethereum } from '@graphprotocol/graph-ts' +import { UniswapQuoter } from '../../generated/LpETH/UniswapQuoter' +import { SwapPool, SwapPoolDay } from '../../generated/schema' + +export const ADDRESS_ZERO = Address.fromString('0x0000000000000000000000000000000000000000') + +export const BD_ZERO = BigDecimal.fromString('0') +export const BI_ZERO = BigInt.fromI32(0) +export const BI_ONE = BigInt.fromI32(1) +export const BD_ONE = BigDecimal.fromString('1') +export const BI_18 = BigInt.fromI32(18) +export const TEN_18 = BigInt.fromU32(10).pow(18) +export const TEN_6 = BigInt.fromU32(10).pow(6) +export const TEN_24 = TEN_18.times(TEN_6) // 18 decimals for normal tokens and 6 decimals for USDC + +export const QUOTER = Address.fromString('0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6') +export const WETH9_ARBITRUM = Address.fromString('0x82aF49447D8a07e3bd95BD0d56f35241523fBab1') +export const USDC_ARBITRUM = Address.fromString('0xaf88d065e77c8cC2239327C5EDb3A432268e5831') +export const USDC_MAINNET = Address.fromString('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') +export const WETH_MAINNET = Address.fromString('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2') +const REBASE_TOPIC = '0x11c6bf55864ff83827df712625d7a80e5583eef0264921025e7cd22003a21511' export const ETHUSD = (): BigDecimal => { - const quoter = UniswapQuoter.bind(QUOTER); + const quoter = UniswapQuoter.bind(QUOTER) // Call Uniswap's quoteExactInputSingle to get the ETH/USDC price const ethUsd = quoter.try_quoteExactInputSingle( @@ -49,98 +30,95 @@ export const ETHUSD = (): BigDecimal => { 3000, // Pool fee (adjust according to the pool you're using) TEN_18, // Amount of ETH (scaled by 10^18 since ETH has 18 decimals) BI_ZERO // Zero for sqrtPriceLimitX96 (no limit) - ); + ) // If the call reverted, return zero - if (ethUsd.reverted) return BD_ZERO; + if (ethUsd.reverted) return BD_ZERO // Convert the result to a decimal and adjust for USDC decimals (6 decimals) - return ethUsd.value.toBigDecimal().div(TEN_6.toBigDecimal()); -}; + return ethUsd.value.toBigDecimal().div(TEN_6.toBigDecimal()) +} export function exponentToBigDecimal(decimals: BigInt): BigDecimal { - let bd = BigDecimal.fromString("1"); + let bd = BigDecimal.fromString('1') for (let i = BI_ZERO; i.lt(decimals as BigInt); i = i.plus(BI_ONE)) { - bd = bd.times(BigDecimal.fromString("10")); + bd = bd.times(BigDecimal.fromString('10')) } - return bd; + return bd } export function convertToDecimal(eth: BigInt): BigDecimal { - return eth.toBigDecimal().div(exponentToBigDecimal(BI_18)); + return eth.toBigDecimal().div(exponentToBigDecimal(BI_18)) } export const calculateDayID = (timestamp: BigInt): BigInt => { - return timestamp.div(BigInt.fromI32(86400)).times(BigInt.fromI32(86400)); -}; + return timestamp.div(BigInt.fromI32(86400)).times(BigInt.fromI32(86400)) +} // Define the return type class DecodedTokenId { - tenderizer: string; - id: BigInt; + tenderizer: string + id: BigInt constructor(tenderizer: string, id: BigInt) { - this.tenderizer = tenderizer; - this.id = id; + this.tenderizer = tenderizer + this.id = id } } export const decodeTokenId = (tokenId: BigInt): DecodedTokenId => { - let hexId = tokenId.toHexString(); - let address = "0x" + hexId.substring(0, 20); - let uint96 = BigInt.fromUnsignedBytes( - Bytes.fromHexString(hexId.substring(20, 32)) - ); + let hexId = tokenId.toHexString() + let address = '0x' + hexId.substring(0, 20) + let uint96 = BigInt.fromUnsignedBytes(Bytes.fromHexString(hexId.substring(20, 32))) // Return the decoded values - return new DecodedTokenId(address, uint96); -}; + return new DecodedTokenId(address, uint96) +} export function findClosestRebaseEvent( receipt: ethereum.TransactionReceipt | null, contractAddress: Address, logIndex: BigInt ): BigDecimal | null { - if (receipt == null) return null; - if (logIndex == BI_ZERO) return null; + if (receipt == null) return null + if (logIndex == BI_ZERO) return null for (let i = receipt.logs.length - 1; i >= 0; i--) { - let log = receipt.logs[i]; - if (log.logIndex.ge(logIndex)) continue; + let log = receipt.logs[i] + if (log.logIndex.ge(logIndex)) continue // Check if the log is from the correct contract - if (log.address != contractAddress) continue; - if (log.topics.length == 0 || log.topics[0].toHexString() != REBASE_TOPIC) - continue; + if (log.address != contractAddress) continue + if (log.topics.length == 0 || log.topics[0].toHexString() != REBASE_TOPIC) continue // Check if the log is a Rebase event - let decoded = ethereum.decode("(uint256,uint256)", log.data); - if (decoded == null) return null; - const t = decoded.toTuple(); - return convertToDecimal(t[0].toBigInt()); + let decoded = ethereum.decode('(uint256,uint256)', log.data) + if (decoded == null) return null + const t = decoded.toTuple() + return convertToDecimal(t[0].toBigInt()) } - return null; + return null } export const initiatePoolDay = (pool: SwapPool, dayID: BigInt): SwapPoolDay => { - const poolDay = new SwapPoolDay(pool.id.concat("-").concat(dayID.toString())); - - poolDay.date = dayID.toI32(); - poolDay.pool = pool.id; - - poolDay.totalSupply = pool.totalSupply; - poolDay.liabilities = pool.liabilities; - poolDay.unlocking = pool.unlocking; - - poolDay.volume = BI_ZERO; - poolDay.volumeUSD = BD_ZERO; - poolDay.fees = BI_ZERO; - poolDay.feesUSD = BD_ZERO; - poolDay.lpRewards = BI_ZERO; - poolDay.lpRewardsUSD = BD_ZERO; - poolDay.treasuryCut = BI_ZERO; - poolDay.treasuryCutUSD = BD_ZERO; - - return poolDay; -}; + const poolDay = new SwapPoolDay(pool.id.concat('-').concat(dayID.toString())) + + poolDay.date = dayID.toI32() + poolDay.pool = pool.id + + poolDay.totalSupply = pool.totalSupply + poolDay.liabilities = pool.liabilities + poolDay.unlocking = pool.unlocking + + poolDay.volume = BI_ZERO + poolDay.volumeUSD = BD_ZERO + poolDay.fees = BI_ZERO + poolDay.feesUSD = BD_ZERO + poolDay.lpRewards = BI_ZERO + poolDay.lpRewardsUSD = BD_ZERO + poolDay.treasuryCut = BI_ZERO + poolDay.treasuryCutUSD = BD_ZERO + + return poolDay +} diff --git a/packages/subgraph/src/mappings/lpeth.ts b/packages/subgraph/src/mappings/lpeth.ts index 0994385..85c4b8a 100644 --- a/packages/subgraph/src/mappings/lpeth.ts +++ b/packages/subgraph/src/mappings/lpeth.ts @@ -1,4 +1,4 @@ -import { BigInt } from "@graphprotocol/graph-ts"; +import { BigInt } from '@graphprotocol/graph-ts' import { BatchUnlockBought as BatchUnlockBoughtEvent, BatchUnlockRedeemed as BatchUnlockRedeemedEvent, @@ -11,7 +11,7 @@ import { UnlockBought as UnlockBoughtEvent, UnlockRedeemed as UnlockRedeemedEvent, Withdraw as WithdrawEvent, -} from "../../generated/LpETH/LpETH"; +} from '../../generated/LpETH/LpETH' import { BatchUnlockBought, BatchUnlockRedeemed, @@ -20,17 +20,18 @@ import { LiquidityPosition, RelayerRewardsClaimed, Swap, - SwapLPTokenTransfer, + SwapLPTokenTransferEvent, SwapPool, SwapPoolDay, UnlockBought, UnlockRedeemed, User, Withdraw, -} from "../../generated/schema"; -import { SwapPoolToken } from "../../generated/templates"; -import { Transfer as LpETHTransferEmitted } from "../../generated/templates/SwapPoolToken/ERC20"; +} from '../../generated/schema' +import { SwapPoolToken } from '../../generated/templates' +import { Transfer as LpETHTransferEmitted } from '../../generated/templates/SwapPoolToken/ERC20' import { + ADDRESS_ZERO, BD_ZERO, BI_ZERO, calculateDayID, @@ -38,425 +39,409 @@ import { ETHUSD, initiatePoolDay, TEN_18, -} from "./helpers"; +} from './helpers' + +const PRELAUNCH_ADDRESS = '0xcC73341a078761AB869D90030D6632F9ea139f2b'.toLowerCase() +const LPETH_ADDRESS = '0xF3a75E087A92770b4150fFF14c6d36FB07796252'.toLowerCase() + export function handleInitialize(event: InitializedEvent): void { - let pool = new SwapPool(event.address.toHex()); - let lpTokenAddr = LpETH.bind(event.address).lpToken(); - - pool.totalSupply = BI_ZERO; - pool.liabilities = BI_ZERO; - pool.volume = BI_ZERO; - pool.volumeUSD = BD_ZERO; - pool.lpRewards = BI_ZERO; - pool.lpRewardsUSD = BD_ZERO; - pool.fees = BI_ZERO; - pool.feesUSD = BD_ZERO; - pool.treasuryCut = BI_ZERO; - pool.treasuryCutUSD = BD_ZERO; - pool.unlocking = BI_ZERO; - pool.id = event.address.toHex(); - pool.numSwaps = BI_ZERO; - pool.lpToken = lpTokenAddr; - pool.save(); - SwapPoolToken.create(lpTokenAddr); + let pool = new SwapPool(event.address.toHex()) + let lpTokenAddr = LpETH.bind(event.address).lpToken() + + pool.totalSupply = BI_ZERO + pool.liabilities = BI_ZERO + pool.volume = BI_ZERO + pool.volumeUSD = BD_ZERO + pool.lpRewards = BI_ZERO + pool.lpRewardsUSD = BD_ZERO + pool.fees = BI_ZERO + pool.feesUSD = BD_ZERO + pool.treasuryCut = BI_ZERO + pool.treasuryCutUSD = BD_ZERO + pool.unlocking = BI_ZERO + pool.id = event.address.toHex() + pool.numSwaps = BI_ZERO + pool.lpToken = lpTokenAddr + pool.save() + SwapPoolToken.create(lpTokenAddr) } export function handleBatchUnlockBought(event: BatchUnlockBoughtEvent): void { - let entity = new BatchUnlockBought( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.caller = event.params.caller; - entity.amount = event.params.amount; - entity.reward = event.params.reward; - entity.lpFees = event.params.lpFees; - entity.tokenIds = event.params.tokenIds; - - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; - - entity.save(); - let pool = SwapPool.load(event.address.toHex()); - if (!pool) return; - - const usdPrice = ETHUSD(); - - const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)); - const treasuryCut = event.params.amount - .minus(event.params.lpFees) - .minus(event.params.reward); - const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)); - - pool.unlocking = pool.unlocking.minus(event.params.amount); - pool.lpRewards = pool.lpRewards.plus(event.params.lpFees); - pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD); - pool.treasuryCut = pool.treasuryCut.plus(treasuryCut); - pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD); - pool.liabilities = pool.liabilities.plus(event.params.lpFees); - pool.save(); - - let dayID = calculateDayID(event.block.timestamp); - let poolDay = SwapPoolDay.load(pool.id.concat("-").concat(dayID.toString())); - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees); - poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD); - poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut); - poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD); - poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees); - poolDay.save(); + let entity = new BatchUnlockBought(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.caller = event.params.caller + entity.amount = event.params.amount + entity.reward = event.params.reward + entity.lpFees = event.params.lpFees + entity.tokenIds = event.params.tokenIds + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash + + entity.save() + let pool = SwapPool.load(event.address.toHex()) + if (!pool) return + + const usdPrice = ETHUSD() + + const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) + const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) + const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) + + pool.unlocking = pool.unlocking.minus(event.params.amount) + pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) + pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) + pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) + pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) + pool.liabilities = pool.liabilities.plus(event.params.lpFees) + pool.save() + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) + poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) + poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) + poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) + poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) + poolDay.save() } -export function handleBatchUnlockRedeemed( - event: BatchUnlockRedeemedEvent -): void { - let entity = new BatchUnlockRedeemed( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.relayer = event.params.relayer; - entity.amount = event.params.amount; - entity.reward = event.params.reward; - entity.lpFees = event.params.lpFees; - entity.tokenIds = event.params.tokenIds; - - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; - - entity.save(); - let pool = SwapPool.load(event.address.toHex()); - if (!pool) return; - - const usdPrice = ETHUSD(); - const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)); - - const treasuryCut = event.params.amount - .minus(event.params.lpFees) - .minus(event.params.reward); - const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)); - - pool.unlocking = pool.unlocking.minus(event.params.amount); - pool.lpRewards = pool.lpRewards.plus(event.params.lpFees); - pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD); - pool.treasuryCut = pool.treasuryCut.plus(treasuryCut); - pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD); - pool.liabilities = pool.liabilities.plus(event.params.lpFees); - pool.save(); - - let dayID = calculateDayID(event.block.timestamp); - let poolDay = SwapPoolDay.load(pool.id.concat("-").concat(dayID.toString())); - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees); - poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD); - poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut); - poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD); - poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees); - poolDay.save(); +export function handleBatchUnlockRedeemed(event: BatchUnlockRedeemedEvent): void { + let entity = new BatchUnlockRedeemed(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.relayer = event.params.relayer + entity.amount = event.params.amount + entity.reward = event.params.reward + entity.lpFees = event.params.lpFees + entity.tokenIds = event.params.tokenIds + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash + + entity.save() + let pool = SwapPool.load(event.address.toHex()) + if (!pool) return + + const usdPrice = ETHUSD() + const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) + + const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) + const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) + + pool.unlocking = pool.unlocking.minus(event.params.amount) + pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) + pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) + pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) + pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) + pool.liabilities = pool.liabilities.plus(event.params.lpFees) + pool.save() + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) + poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) + poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) + poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) + poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) + poolDay.save() } -export function handleClaimWithdrawRequest( - event: ClaimWithdrawRequestEvent -): void { - let entity = new ClaimWithdrawRequest( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.requestId = event.params.requestId; - entity.to = event.params.to; - entity.amount = event.params.amount; - - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; - - entity.save(); +export function handleClaimWithdrawRequest(event: ClaimWithdrawRequestEvent): void { + let entity = new ClaimWithdrawRequest(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.requestId = event.params.requestId + entity.to = event.params.to + entity.amount = event.params.amount + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash + + entity.save() } export function handleSwap(event: SwapEvent): void { - let pool = SwapPool.load(event.address.toHex()); - if (pool == null) return; - - const usdPrice = ETHUSD(); - const amountInUSD = usdPrice.times(convertToDecimal(event.params.amountIn)); - const feeInUSD = usdPrice.times(convertToDecimal(event.params.fee)); - let numSwaps = pool.numSwaps.plus(BigInt.fromI32(1)); - let swapId = event.params.caller - .toHex() - .concat("-") - .concat(numSwaps.toString()); - let swap = new Swap(swapId); - swap.pool = pool.id; - swap.amount = event.params.amountIn; - swap.amountUSD = amountInUSD; - swap.fee = event.params.fee; - swap.feeUSD = feeInUSD; - swap.asset = event.params.asset; - swap.from = event.params.caller; - swap.blockNumber = event.block.number; - swap.blockTimestamp = event.block.timestamp; - swap.transactionHash = event.transaction.hash; - swap.save(); - - pool.unlocking = pool.unlocking.plus(event.params.amountIn); - pool.volume = pool.volume.plus(event.params.amountIn); - pool.volumeUSD = pool.volumeUSD.plus(amountInUSD); - pool.fees = pool.fees.plus(event.params.fee); - pool.feesUSD = pool.feesUSD.plus(feeInUSD); - pool.numSwaps = numSwaps; - pool.save(); - - let dayID = calculateDayID(event.block.timestamp); - let poolDay = SwapPoolDay.load(pool.id.concat("-").concat(dayID.toString())); - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.volume = poolDay.volume.plus(event.params.amountIn); - poolDay.volumeUSD = poolDay.volumeUSD.plus(amountInUSD); - poolDay.fees = poolDay.fees.plus(event.params.fee); - poolDay.feesUSD = poolDay.feesUSD.plus(feeInUSD); - poolDay.save(); + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return + + const usdPrice = ETHUSD() + const amountInUSD = usdPrice.times(convertToDecimal(event.params.amountIn)) + const feeInUSD = usdPrice.times(convertToDecimal(event.params.fee)) + let numSwaps = pool.numSwaps.plus(BigInt.fromI32(1)) + let swapId = event.params.caller.toHex().concat('-').concat(numSwaps.toString()) + let swap = new Swap(swapId) + swap.pool = pool.id + swap.amount = event.params.amountIn + swap.amountUSD = amountInUSD + swap.fee = event.params.fee + swap.feeUSD = feeInUSD + swap.asset = event.params.asset + swap.from = event.params.caller + swap.blockNumber = event.block.number + swap.blockTimestamp = event.block.timestamp + swap.transactionHash = event.transaction.hash + swap.save() + + pool.unlocking = pool.unlocking.plus(event.params.amountIn) + pool.volume = pool.volume.plus(event.params.amountIn) + pool.volumeUSD = pool.volumeUSD.plus(amountInUSD) + pool.fees = pool.fees.plus(event.params.fee) + pool.feesUSD = pool.feesUSD.plus(feeInUSD) + pool.numSwaps = numSwaps + pool.save() + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.volume = poolDay.volume.plus(event.params.amountIn) + poolDay.volumeUSD = poolDay.volumeUSD.plus(amountInUSD) + poolDay.fees = poolDay.fees.plus(event.params.fee) + poolDay.feesUSD = poolDay.feesUSD.plus(feeInUSD) + poolDay.save() } export function handleWithdraw(event: WithdrawEvent): void { - let entity = new Withdraw( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.to = event.params.to; - entity.amount = event.params.amount; - entity.lpSharesBurnt = event.params.lpSharesBurnt; - entity.requestId = event.params.requestId; + let entity = new Withdraw(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.to = event.params.to + entity.amount = event.params.amount + entity.lpSharesBurnt = event.params.lpSharesBurnt + entity.requestId = event.params.requestId - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash - entity.save(); + entity.save() - let pool = SwapPool.load(event.address.toHex()); - if (pool == null) return; + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return - let user = event.params.to.toHex(); - let lp = LiquidityPosition.load(user.concat("-").concat(pool.id)); + let user = event.params.to.toHex() + let lp = LiquidityPosition.load(user.concat('-').concat(pool.id)) if (lp != null) { - let bal = lp.shares.times(pool.liabilities.div(pool.totalSupply)); - let amount = event.params.amount; + let bal = lp.shares.times(pool.liabilities).div(pool.totalSupply) + let amount = event.params.amount if (bal.minus(lp.netDeposits).lt(amount)) { // if rewards less than amount, set net deposits // to balance minus what wasnt subtracted from the rewards - lp.netDeposits = bal.minus(amount); + lp.netDeposits = bal.minus(amount) } else { // withdrawn rewards, do nothing } - lp.shares = lp.shares.minus(event.params.lpSharesBurnt); - lp.save(); + lp.shares = lp.shares.minus(event.params.lpSharesBurnt) + lp.save() } - pool.totalSupply = pool.totalSupply.minus(event.params.lpSharesBurnt); - pool.liabilities = pool.liabilities.minus(event.params.amount); + pool.totalSupply = pool.totalSupply.minus(event.params.lpSharesBurnt) + pool.liabilities = pool.liabilities.minus(event.params.amount) - let dayID = calculateDayID(event.block.timestamp); - let poolDay = SwapPoolDay.load(pool.id.concat("-").concat(dayID.toString())); - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) - poolDay.save(); - pool.save(); + poolDay.save() + pool.save() } export function handleDeposit(event: DepositEvent): void { - let entity = new Deposit( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.from = event.params.from; - entity.amount = event.params.amount; - entity.lpSharesMinted = event.params.lpSharesMinted; + let entity = new Deposit(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.from = event.params.from + entity.amount = event.params.amount + entity.lpSharesMinted = event.params.lpSharesMinted + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; + entity.save() - entity.save(); + let pool = SwapPool.load(event.address.toHex()) + if (pool == null) return - let pool = SwapPool.load(event.address.toHex()); - if (pool == null) return; + pool.totalSupply = pool.totalSupply.plus(event.params.lpSharesMinted) + pool.liabilities = pool.liabilities.plus(event.params.amount) - pool.totalSupply = pool.totalSupply.plus(event.params.lpSharesMinted); - pool.liabilities = pool.liabilities.plus(event.params.amount); + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) - let dayID = calculateDayID(event.block.timestamp); - let poolDay = SwapPoolDay.load(pool.id.concat("-").concat(dayID.toString())); - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); + poolDay.save() + pool.save() - let from = event.params.from.toHex(); - let user = User.load(from); + let from = event.params.from.toHex() + if (from == PRELAUNCH_ADDRESS) return + let user = User.load(from) if (user == null) { - user = new User(from); - user.save(); + user = new User(from) + user.save() } - let lp = LiquidityPosition.load(from.concat("-").concat(pool.id)); + let lp = LiquidityPosition.load(from.concat('-').concat(pool.id)) if (lp == null) { - lp = new LiquidityPosition(from.concat("-").concat(pool.id)); - lp.user = from; - lp.pool = pool.id; - lp.shares = BI_ZERO; - lp.netDeposits = BI_ZERO; + lp = new LiquidityPosition(from.concat('-').concat(pool.id)) + lp.user = from + lp.pool = pool.id + lp.shares = BI_ZERO + lp.netDeposits = BI_ZERO } - lp.shares = lp.shares.plus(event.params.lpSharesMinted); - lp.netDeposits = lp.netDeposits.plus(event.params.amount); - lp.save(); - poolDay.save(); - pool.save(); + lp.shares = lp.shares.plus(event.params.lpSharesMinted) + lp.netDeposits = lp.netDeposits.plus(event.params.amount) + lp.save() } -export function handleRelayerRewardsClaimed( - event: RelayerRewardsClaimedEvent -): void { - let entity = new RelayerRewardsClaimed( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.relayer = event.params.relayer; - entity.rewards = event.params.rewards; +export function handleRelayerRewardsClaimed(event: RelayerRewardsClaimedEvent): void { + let entity = new RelayerRewardsClaimed(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.relayer = event.params.relayer + entity.rewards = event.params.rewards - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash - entity.save(); + entity.save() } export function handleUnlockBought(event: UnlockBoughtEvent): void { - let entity = new UnlockBought( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.caller = event.params.caller; - entity.tokenId = event.params.tokenId; - entity.amount = event.params.amount; - entity.reward = event.params.reward; - entity.lpFees = event.params.lpFees; - - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; - - entity.save(); - let pool = SwapPool.load(event.address.toHex()); - if (!pool) return; - - const usdPrice = ETHUSD(); - - const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)); - const treasuryCut = event.params.amount - .minus(event.params.lpFees) - .minus(event.params.reward); - const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)); - - pool.unlocking = pool.unlocking.minus(event.params.amount); - pool.lpRewards = pool.lpRewards.plus(event.params.lpFees); - pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD); - pool.treasuryCut = pool.treasuryCut.plus(treasuryCut); - pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD); - pool.liabilities = pool.liabilities.plus(event.params.lpFees); - pool.save(); - - let dayID = calculateDayID(event.block.timestamp); - let poolDay = SwapPoolDay.load(pool.id.concat("-").concat(dayID.toString())); - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees); - poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD); - poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut); - poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD); - poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees); - poolDay.save(); + let entity = new UnlockBought(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.caller = event.params.caller + entity.tokenId = event.params.tokenId + entity.amount = event.params.amount + entity.reward = event.params.reward + entity.lpFees = event.params.lpFees + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash + + entity.save() + let pool = SwapPool.load(event.address.toHex()) + if (!pool) return + + const usdPrice = ETHUSD() + + const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) + const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) + const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) + + pool.unlocking = pool.unlocking.minus(event.params.amount) + pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) + pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) + pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) + pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) + pool.liabilities = pool.liabilities.plus(event.params.lpFees) + pool.save() + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) + poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) + poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) + poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) + poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) + poolDay.save() } export function handleUnlockRedeemed(event: UnlockRedeemedEvent): void { - let entity = new UnlockRedeemed( - event.transaction.hash.concatI32(event.logIndex.toI32()) - ); - entity.relayer = event.params.relayer; - entity.tokenId = event.params.tokenId; - entity.amount = event.params.amount; - entity.reward = event.params.reward; - entity.lpFees = event.params.lpFees; - - entity.blockNumber = event.block.number; - entity.blockTimestamp = event.block.timestamp; - entity.transactionHash = event.transaction.hash; - - entity.save(); - let pool = SwapPool.load(event.address.toHex()); - if (!pool) return; - - const usdPrice = ETHUSD(); - const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)); - - const treasuryCut = event.params.amount - .minus(event.params.lpFees) - .minus(event.params.reward); - const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)); - - pool.unlocking = pool.unlocking.minus(event.params.amount); - pool.lpRewards = pool.lpRewards.plus(event.params.lpFees); - pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD); - pool.treasuryCut = pool.treasuryCut.plus(treasuryCut); - pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD); - pool.liabilities = pool.liabilities.plus(event.params.lpFees); - pool.save(); - - let dayID = calculateDayID(event.block.timestamp); - let poolDay = SwapPoolDay.load(pool.id.concat("-").concat(dayID.toString())); - if (poolDay == null) poolDay = initiatePoolDay(pool, dayID); - poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees); - poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD); - poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut); - poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD); - poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees); - poolDay.save(); + let entity = new UnlockRedeemed(event.transaction.hash.concatI32(event.logIndex.toI32())) + entity.relayer = event.params.relayer + entity.tokenId = event.params.tokenId + entity.amount = event.params.amount + entity.reward = event.params.reward + entity.lpFees = event.params.lpFees + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash + + entity.save() + let pool = SwapPool.load(event.address.toHex()) + if (!pool) return + + const usdPrice = ETHUSD() + const lpRewardsInUSD = usdPrice.times(convertToDecimal(event.params.lpFees)) + + const treasuryCut = event.params.amount.minus(event.params.lpFees).minus(event.params.reward) + const treasuryCutInUSD = usdPrice.times(convertToDecimal(treasuryCut)) + + pool.unlocking = pool.unlocking.minus(event.params.amount) + pool.lpRewards = pool.lpRewards.plus(event.params.lpFees) + pool.lpRewardsUSD = pool.lpRewardsUSD.plus(lpRewardsInUSD) + pool.treasuryCut = pool.treasuryCut.plus(treasuryCut) + pool.treasuryCutUSD = pool.treasuryCutUSD.plus(treasuryCutInUSD) + pool.liabilities = pool.liabilities.plus(event.params.lpFees) + pool.save() + + let dayID = calculateDayID(event.block.timestamp) + let poolDay = SwapPoolDay.load(pool.id.concat('-').concat(dayID.toString())) + if (poolDay == null) poolDay = initiatePoolDay(pool, dayID) + poolDay.lpRewards = poolDay.lpRewards.plus(event.params.lpFees) + poolDay.lpRewardsUSD = poolDay.lpRewardsUSD.plus(lpRewardsInUSD) + poolDay.treasuryCut = poolDay.treasuryCut.plus(treasuryCut) + poolDay.treasuryCutUSD = poolDay.treasuryCutUSD.plus(treasuryCutInUSD) + poolDay.liabilities = poolDay.liabilities.plus(event.params.lpFees) + poolDay.save() } export function handleLpETHTransfer(event: LpETHTransferEmitted): void { - let pool = SwapPool.load(event.address.toHex()); - if (pool == null) return; - - let from = event.params.from.toHex(); - let to = event.params.to.toHex(); - let toUser = User.load(to); + // burn + if (event.params.to.toHex() == '0x0000000000000000000000000000000000000000') return + // mint + if (event.params.from.toHex() == '0x0000000000000000000000000000000000000000') return + let pool = SwapPool.load(LPETH_ADDRESS) + if (pool == null) return + + let from = event.params.from.toHex() + let to = event.params.to.toHex() + let toUser = User.load(to) if (toUser == null) { - toUser = new User(to); - toUser.save(); + toUser = new User(to) + toUser.save() } - let lp = LiquidityPosition.load(from.concat("-").concat(pool.id)); + let lpTo = LiquidityPosition.load(to.concat('-').concat(pool.id)) + if (lpTo == null) { + lpTo = new LiquidityPosition(to.concat('-').concat(pool.id)) + lpTo.user = to + lpTo.pool = pool.id + lpTo.shares = BI_ZERO + lpTo.netDeposits = BI_ZERO + } + let shares = event.params.value + let value = shares.times(pool.liabilities).div(pool.totalSupply) + lpTo.shares = lpTo.shares.plus(shares) + lpTo.netDeposits = lpTo.netDeposits.plus(value) + lpTo.save() + + let transfer = new SwapLPTokenTransferEvent( + event.transaction.hash.toHex().concat('-').concat(event.logIndex.toString()) + ) + transfer.timestamp = event.block.timestamp.toI32() + transfer.blockNumber = event.block.number + transfer.from = from + transfer.to = to + transfer.shares = shares + transfer.value = value + transfer.SwapPool = pool.id + transfer.save() + + if (from == PRELAUNCH_ADDRESS) return + + let lp = LiquidityPosition.load(from.concat('-').concat(pool.id)) if (lp != null) { - let totalSupply = pool.totalSupply; - let bal = lp.shares - .times(pool.liabilities.times(TEN_18).div(totalSupply)) - .div(TEN_18); - let amount = event.params.value; - if (bal.minus(lp.netDeposits).lt(amount)) { + lp.shares = lp.shares.minus(event.params.value) + let totalSupply = pool.totalSupply + let bal = lp.shares.times(pool.liabilities).div(totalSupply) + if (bal.minus(lp.netDeposits).lt(value)) { // if rewards less than amount, set net deposits // to balance minus what wasnt subtracted from the rewards - lp.netDeposits = bal.minus(amount); + let remainder = value.minus(bal.minus(lp.netDeposits)) + if (remainder.lt(lp.netDeposits)) { + lp.netDeposits = bal.minus(remainder) + } else { + lp.netDeposits = BI_ZERO + } } - lp.save(); - } - - let lpTo = LiquidityPosition.load(to.concat("-").concat(pool.id)); - if (lpTo == null) { - lpTo = new LiquidityPosition(to.concat("-").concat(pool.id)); - lpTo.user = to; - lpTo.pool = pool.id; - lpTo.shares = BI_ZERO; - lpTo.netDeposits = BI_ZERO; + lp.save() } - let shares = event.params.value.times(pool.totalSupply).div(pool.liabilities); - lpTo.shares = lpTo.shares.plus(shares); - lpTo.netDeposits = lpTo.netDeposits.plus(event.params.value); - lpTo.save(); - - let transfer = new SwapLPTokenTransfer( - event.transaction.hash.toHex().concat("-").concat(event.logIndex.toString()) - ); - transfer.timestamp = event.block.timestamp.toI32(); - transfer.blockNumber = event.block.number; - transfer.from = from; - transfer.to = to; - transfer.amount = event.params.value; - transfer.SwapPool = pool.id; - transfer.save(); } diff --git a/packages/subgraph/src/mappings/prelaunch.ts b/packages/subgraph/src/mappings/prelaunch.ts new file mode 100644 index 0000000..9fab189 --- /dev/null +++ b/packages/subgraph/src/mappings/prelaunch.ts @@ -0,0 +1,170 @@ +import { BigDecimal, BigInt } from '@graphprotocol/graph-ts' +import { + DepositETHCall, + DepositWETHCall, + WithdrawCall, + ClaimVeTokensCall, + ChangeLockupCall, +} from '../../generated/PreLaunch/PreLaunch' +import { Deposit, Withdraw, PreLaunchPosition, PreLaunch } from '../../generated/schema' +import { BI_ZERO, TEN_18 } from './helpers' +import { log } from '@graphprotocol/graph-ts' + +const LPETH_ADDRESS = '0xF3a75E087A92770b4150fFF14c6d36FB07796252'.toLowerCase() + +const DEADLINE = 1728746087 +const MIN_LOCKUP = TEN_18 +const MAX_LOCKUP = BigInt.fromI32(52).times(TEN_18) +const EPOCH_LENGTH = 604800 +const MIN_MULTIPLIER = BigInt.fromString('100000000000000000') +const MAX_MULTIPLIER = BigInt.fromString('5000000000000000000') +const SLOPE = BigInt.fromString('2500000000000000000') + +// const calculateWeightedDeposit = (amount: BigInt, epochs: BigInt):BigInt => { +// if (epochs.lt(MIN_LOCKUP)) { +// return BI_ZERO +// } +// return amount.times(MIN_MULTIPLIER.plus(MAX_MULTIPLIER.minus(MIN_MULTIPLIER)).times( +// epochs.minus(MIN_LOCKUP).div(MAX_LOCKUP.minus(MIN_LOCKUP)).pow(SLOPE) +// )) +// } + +const calculateWeightedDeposit = (amount: BigInt, epochs: BigInt): BigInt => { + let x = parseFloat(amount.toBigDecimal().div(TEN_18.toBigDecimal()).toString()) + let e = parseInt(epochs.toString(), 10) + + let w = ((x * (1 + (5 - 1)) * (e - 1)) / (52 - 1)) ** 2.5 + w = Math.floor(w * 10 ** 18) + + return BigInt.fromString(BigDecimal.fromString(w.toString()).toString()) +} + +export function handleDepositETH(call: DepositETHCall): void { + let amount = call.transaction.value + + let preLaunch = PreLaunch.load(call.to.toHexString()) + if (preLaunch == null) { + preLaunch = new PreLaunch(call.to.toHexString()) + preLaunch.amount = BI_ZERO + preLaunch.weightedAmount = BI_ZERO + } + + let position = PreLaunchPosition.load(call.from.toHexString()) + if (position == null) { + position = new PreLaunchPosition(call.from.toHexString()) + position.claimed = false + position.amount = amount + position.duration = call.inputs.duration + position.account = call.from + } else { + position.amount = position.amount.plus(amount) + position.duration = call.inputs.duration + + // subtract the current weighted amount from the total + // we will add it back after we calculate the new weighted amount + // in case the duration changed + preLaunch.weightedAmount = preLaunch.weightedAmount.minus(position.weightedAmount) + } + + let weighted = calculateWeightedDeposit(position.amount, position.duration) + log.debug('Weighted amount: {}', [weighted.toString()]) + position.weightedAmount = weighted + position.save() + + preLaunch.amount = preLaunch.amount.plus(amount) + preLaunch.weightedAmount = preLaunch.weightedAmount.plus(weighted) + preLaunch.save() +} + +export function handleDepositWETH(call: DepositWETHCall): void { + let amount = call.inputs.amount + + let preLaunch = PreLaunch.load(call.to.toHexString()) + if (preLaunch == null) { + preLaunch = new PreLaunch(call.to.toHexString()) + preLaunch.amount = BI_ZERO + preLaunch.weightedAmount = BI_ZERO + } + + let position = PreLaunchPosition.load(call.from.toHexString()) + if (position == null) { + position = new PreLaunchPosition(call.from.toHexString()) + position.claimed = false + position.amount = amount + position.duration = call.inputs.duration + position.account = call.from + } else { + position.amount = position.amount.plus(amount) + position.duration = call.inputs.duration + + // subtract the current weighted amount from the total + // we will add it back after we calculate the new weighted amount + // in case the duration changed + preLaunch.weightedAmount = preLaunch.weightedAmount.minus(position.weightedAmount) + } + + let weighted = calculateWeightedDeposit(position.amount, position.duration) + position.weightedAmount = weighted + position.save() + + preLaunch.amount = preLaunch.amount.plus(amount) + preLaunch.weightedAmount = preLaunch.weightedAmount.plus(weighted) + preLaunch.save() +} + +export function handleWithdraw(call: WithdrawCall): void { + let amount = call.inputs.amount + + let preLaunch = PreLaunch.load(call.to.toHexString()) + if (preLaunch == null) { + preLaunch = new PreLaunch(call.to.toHexString()) + } + + let position = PreLaunchPosition.load(call.from.toHexString()) + if (position != null) { + position.amount = position.amount.minus(amount) + + let weighted = calculateWeightedDeposit(amount, position.duration) + position.weightedAmount = position.weightedAmount.minus(weighted) + position.save() + + preLaunch.amount = preLaunch.amount.minus(amount) + preLaunch.weightedAmount = preLaunch.weightedAmount.minus(weighted) + preLaunch.save() + } +} + +export function handleClaim(call: ClaimVeTokensCall): void { + // convert prelaunch into LiquidityPosition + let position = PreLaunchPosition.load(call.from.toHexString()) + if (position == null) { + return + } + position.claimed = true + position.claimedAt = call.block.timestamp + position.save() + + // liquidity position and user is created by the LP token transfer event from the pre-launch contract to this one +} + +export function handleChangeLockup(call: ChangeLockupCall): void { + let preLaunch = PreLaunch.load(call.to.toHexString()) + if (preLaunch == null) { + preLaunch = new PreLaunch(call.to.toHexString()) + } + let position = PreLaunchPosition.load(call.from.toHexString()) + if (position != null) { + let oldWeighted = calculateWeightedDeposit(position.amount, position.duration) + // subtract the current weighted amount from the total + // we will add it back after we calculate the new weighted amount + preLaunch.weightedAmount = preLaunch.weightedAmount.minus(oldWeighted) + + let weighted = calculateWeightedDeposit(position.amount, call.inputs.duration) + position.weightedAmount = weighted + position.duration = call.inputs.duration + position.save() + + preLaunch.weightedAmount = preLaunch.weightedAmount.plus(weighted) + preLaunch.save() + } +} diff --git a/packages/subgraph/subgraph.yaml b/packages/subgraph/subgraph.yaml index d0b726b..040bef8 100644 --- a/packages/subgraph/subgraph.yaml +++ b/packages/subgraph/subgraph.yaml @@ -4,6 +4,35 @@ indexerHints: schema: file: ./schema.graphql dataSources: + - kind: ethereum/contract + name: PreLaunch + network: mainnet + source: + address: "0xcC73341a078761AB869D90030D6632F9ea139f2b" + abi: PreLaunch + startBlock: 20692554 + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + entities: + - Deposit + - LiquidityPosition + abis: + - name: PreLaunch + file: ./abis/Prelaunch.json + callHandlers: + - function: depositETH(uint256) + handler: handleDepositETH + - function: depositWETH(uint256,uint256) + handler: handleDepositWETH + - function: withdraw(uint256) + handler: handleWithdraw + - function: claimVeTokens() + handler: handleClaim + - function: changeLockup(uint256) + handler: handleChangeLockup + file: ./src/mappings/prelaunch.ts - kind: ethereum name: lpeth network: mainnet diff --git a/packages/subgraph/tests/lp-eth-utils.ts b/packages/subgraph/tests/lp-eth-utils.ts index bc869cf..f6cf271 100644 --- a/packages/subgraph/tests/lp-eth-utils.ts +++ b/packages/subgraph/tests/lp-eth-utils.ts @@ -1,5 +1,5 @@ -import { newMockEvent } from "matchstick-as" -import { ethereum, Address, BigInt } from "@graphprotocol/graph-ts" +import { newMockEvent } from 'matchstick-as' +import { ethereum, Address, BigInt } from '@graphprotocol/graph-ts' import { BatchUnlockBought, BatchUnlockRedeemed, @@ -12,8 +12,8 @@ import { UnlockBought, UnlockRedeemed, Upgraded, - Withdraw -} from "../generated/LpETH/LpETH" + Withdraw, +} from '../generated/LpETH/LpETH' export function createBatchUnlockBoughtEvent( caller: Address, @@ -26,23 +26,12 @@ export function createBatchUnlockBoughtEvent( batchUnlockBoughtEvent.parameters = new Array() + batchUnlockBoughtEvent.parameters.push(new ethereum.EventParam('caller', ethereum.Value.fromAddress(caller))) + batchUnlockBoughtEvent.parameters.push(new ethereum.EventParam('amount', ethereum.Value.fromUnsignedBigInt(amount))) + batchUnlockBoughtEvent.parameters.push(new ethereum.EventParam('reward', ethereum.Value.fromUnsignedBigInt(reward))) + batchUnlockBoughtEvent.parameters.push(new ethereum.EventParam('lpFees', ethereum.Value.fromUnsignedBigInt(lpFees))) batchUnlockBoughtEvent.parameters.push( - new ethereum.EventParam("caller", ethereum.Value.fromAddress(caller)) - ) - batchUnlockBoughtEvent.parameters.push( - new ethereum.EventParam("amount", ethereum.Value.fromUnsignedBigInt(amount)) - ) - batchUnlockBoughtEvent.parameters.push( - new ethereum.EventParam("reward", ethereum.Value.fromUnsignedBigInt(reward)) - ) - batchUnlockBoughtEvent.parameters.push( - new ethereum.EventParam("lpFees", ethereum.Value.fromUnsignedBigInt(lpFees)) - ) - batchUnlockBoughtEvent.parameters.push( - new ethereum.EventParam( - "tokenIds", - ethereum.Value.fromUnsignedBigIntArray(tokenIds) - ) + new ethereum.EventParam('tokenIds', ethereum.Value.fromUnsignedBigIntArray(tokenIds)) ) return batchUnlockBoughtEvent @@ -59,75 +48,42 @@ export function createBatchUnlockRedeemedEvent( batchUnlockRedeemedEvent.parameters = new Array() + batchUnlockRedeemedEvent.parameters.push(new ethereum.EventParam('relayer', ethereum.Value.fromAddress(relayer))) + batchUnlockRedeemedEvent.parameters.push(new ethereum.EventParam('amount', ethereum.Value.fromUnsignedBigInt(amount))) + batchUnlockRedeemedEvent.parameters.push(new ethereum.EventParam('reward', ethereum.Value.fromUnsignedBigInt(reward))) + batchUnlockRedeemedEvent.parameters.push(new ethereum.EventParam('lpFees', ethereum.Value.fromUnsignedBigInt(lpFees))) batchUnlockRedeemedEvent.parameters.push( - new ethereum.EventParam("relayer", ethereum.Value.fromAddress(relayer)) - ) - batchUnlockRedeemedEvent.parameters.push( - new ethereum.EventParam("amount", ethereum.Value.fromUnsignedBigInt(amount)) - ) - batchUnlockRedeemedEvent.parameters.push( - new ethereum.EventParam("reward", ethereum.Value.fromUnsignedBigInt(reward)) - ) - batchUnlockRedeemedEvent.parameters.push( - new ethereum.EventParam("lpFees", ethereum.Value.fromUnsignedBigInt(lpFees)) - ) - batchUnlockRedeemedEvent.parameters.push( - new ethereum.EventParam( - "tokenIds", - ethereum.Value.fromUnsignedBigIntArray(tokenIds) - ) + new ethereum.EventParam('tokenIds', ethereum.Value.fromUnsignedBigIntArray(tokenIds)) ) return batchUnlockRedeemedEvent } -export function createClaimWithdrawRequestEvent( - requestId: BigInt, - to: Address, - amount: BigInt -): ClaimWithdrawRequest { - let claimWithdrawRequestEvent = changetype( - newMockEvent() - ) +export function createClaimWithdrawRequestEvent(requestId: BigInt, to: Address, amount: BigInt): ClaimWithdrawRequest { + let claimWithdrawRequestEvent = changetype(newMockEvent()) claimWithdrawRequestEvent.parameters = new Array() claimWithdrawRequestEvent.parameters.push( - new ethereum.EventParam( - "requestId", - ethereum.Value.fromUnsignedBigInt(requestId) - ) + new ethereum.EventParam('requestId', ethereum.Value.fromUnsignedBigInt(requestId)) ) + claimWithdrawRequestEvent.parameters.push(new ethereum.EventParam('to', ethereum.Value.fromAddress(to))) claimWithdrawRequestEvent.parameters.push( - new ethereum.EventParam("to", ethereum.Value.fromAddress(to)) - ) - claimWithdrawRequestEvent.parameters.push( - new ethereum.EventParam("amount", ethereum.Value.fromUnsignedBigInt(amount)) + new ethereum.EventParam('amount', ethereum.Value.fromUnsignedBigInt(amount)) ) return claimWithdrawRequestEvent } -export function createDepositEvent( - from: Address, - amount: BigInt, - lpSharesMinted: BigInt -): Deposit { +export function createDepositEvent(from: Address, amount: BigInt, lpSharesMinted: BigInt): Deposit { let depositEvent = changetype(newMockEvent()) depositEvent.parameters = new Array() + depositEvent.parameters.push(new ethereum.EventParam('from', ethereum.Value.fromAddress(from))) + depositEvent.parameters.push(new ethereum.EventParam('amount', ethereum.Value.fromUnsignedBigInt(amount))) depositEvent.parameters.push( - new ethereum.EventParam("from", ethereum.Value.fromAddress(from)) - ) - depositEvent.parameters.push( - new ethereum.EventParam("amount", ethereum.Value.fromUnsignedBigInt(amount)) - ) - depositEvent.parameters.push( - new ethereum.EventParam( - "lpSharesMinted", - ethereum.Value.fromUnsignedBigInt(lpSharesMinted) - ) + new ethereum.EventParam('lpSharesMinted', ethereum.Value.fromUnsignedBigInt(lpSharesMinted)) ) return depositEvent @@ -138,57 +94,32 @@ export function createInitializedEvent(version: BigInt): Initialized { initializedEvent.parameters = new Array() - initializedEvent.parameters.push( - new ethereum.EventParam( - "version", - ethereum.Value.fromUnsignedBigInt(version) - ) - ) + initializedEvent.parameters.push(new ethereum.EventParam('version', ethereum.Value.fromUnsignedBigInt(version))) return initializedEvent } -export function createOwnershipTransferredEvent( - previousOwner: Address, - newOwner: Address -): OwnershipTransferred { - let ownershipTransferredEvent = changetype( - newMockEvent() - ) +export function createOwnershipTransferredEvent(previousOwner: Address, newOwner: Address): OwnershipTransferred { + let ownershipTransferredEvent = changetype(newMockEvent()) ownershipTransferredEvent.parameters = new Array() ownershipTransferredEvent.parameters.push( - new ethereum.EventParam( - "previousOwner", - ethereum.Value.fromAddress(previousOwner) - ) - ) - ownershipTransferredEvent.parameters.push( - new ethereum.EventParam("newOwner", ethereum.Value.fromAddress(newOwner)) + new ethereum.EventParam('previousOwner', ethereum.Value.fromAddress(previousOwner)) ) + ownershipTransferredEvent.parameters.push(new ethereum.EventParam('newOwner', ethereum.Value.fromAddress(newOwner))) return ownershipTransferredEvent } -export function createRelayerRewardsClaimedEvent( - relayer: Address, - rewards: BigInt -): RelayerRewardsClaimed { - let relayerRewardsClaimedEvent = changetype( - newMockEvent() - ) +export function createRelayerRewardsClaimedEvent(relayer: Address, rewards: BigInt): RelayerRewardsClaimed { + let relayerRewardsClaimedEvent = changetype(newMockEvent()) relayerRewardsClaimedEvent.parameters = new Array() + relayerRewardsClaimedEvent.parameters.push(new ethereum.EventParam('relayer', ethereum.Value.fromAddress(relayer))) relayerRewardsClaimedEvent.parameters.push( - new ethereum.EventParam("relayer", ethereum.Value.fromAddress(relayer)) - ) - relayerRewardsClaimedEvent.parameters.push( - new ethereum.EventParam( - "rewards", - ethereum.Value.fromUnsignedBigInt(rewards) - ) + new ethereum.EventParam('rewards', ethereum.Value.fromUnsignedBigInt(rewards)) ) return relayerRewardsClaimedEvent @@ -205,27 +136,11 @@ export function createSwapEvent( swapEvent.parameters = new Array() - swapEvent.parameters.push( - new ethereum.EventParam("caller", ethereum.Value.fromAddress(caller)) - ) - swapEvent.parameters.push( - new ethereum.EventParam("asset", ethereum.Value.fromAddress(asset)) - ) - swapEvent.parameters.push( - new ethereum.EventParam( - "amountIn", - ethereum.Value.fromUnsignedBigInt(amountIn) - ) - ) - swapEvent.parameters.push( - new ethereum.EventParam("fee", ethereum.Value.fromUnsignedBigInt(fee)) - ) - swapEvent.parameters.push( - new ethereum.EventParam( - "unlockId", - ethereum.Value.fromUnsignedBigInt(unlockId) - ) - ) + swapEvent.parameters.push(new ethereum.EventParam('caller', ethereum.Value.fromAddress(caller))) + swapEvent.parameters.push(new ethereum.EventParam('asset', ethereum.Value.fromAddress(asset))) + swapEvent.parameters.push(new ethereum.EventParam('amountIn', ethereum.Value.fromUnsignedBigInt(amountIn))) + swapEvent.parameters.push(new ethereum.EventParam('fee', ethereum.Value.fromUnsignedBigInt(fee))) + swapEvent.parameters.push(new ethereum.EventParam('unlockId', ethereum.Value.fromUnsignedBigInt(unlockId))) return swapEvent } @@ -241,24 +156,11 @@ export function createUnlockBoughtEvent( unlockBoughtEvent.parameters = new Array() - unlockBoughtEvent.parameters.push( - new ethereum.EventParam("caller", ethereum.Value.fromAddress(caller)) - ) - unlockBoughtEvent.parameters.push( - new ethereum.EventParam( - "tokenId", - ethereum.Value.fromUnsignedBigInt(tokenId) - ) - ) - unlockBoughtEvent.parameters.push( - new ethereum.EventParam("amount", ethereum.Value.fromUnsignedBigInt(amount)) - ) - unlockBoughtEvent.parameters.push( - new ethereum.EventParam("reward", ethereum.Value.fromUnsignedBigInt(reward)) - ) - unlockBoughtEvent.parameters.push( - new ethereum.EventParam("lpFees", ethereum.Value.fromUnsignedBigInt(lpFees)) - ) + unlockBoughtEvent.parameters.push(new ethereum.EventParam('caller', ethereum.Value.fromAddress(caller))) + unlockBoughtEvent.parameters.push(new ethereum.EventParam('tokenId', ethereum.Value.fromUnsignedBigInt(tokenId))) + unlockBoughtEvent.parameters.push(new ethereum.EventParam('amount', ethereum.Value.fromUnsignedBigInt(amount))) + unlockBoughtEvent.parameters.push(new ethereum.EventParam('reward', ethereum.Value.fromUnsignedBigInt(reward))) + unlockBoughtEvent.parameters.push(new ethereum.EventParam('lpFees', ethereum.Value.fromUnsignedBigInt(lpFees))) return unlockBoughtEvent } @@ -274,24 +176,11 @@ export function createUnlockRedeemedEvent( unlockRedeemedEvent.parameters = new Array() - unlockRedeemedEvent.parameters.push( - new ethereum.EventParam("relayer", ethereum.Value.fromAddress(relayer)) - ) - unlockRedeemedEvent.parameters.push( - new ethereum.EventParam( - "tokenId", - ethereum.Value.fromUnsignedBigInt(tokenId) - ) - ) - unlockRedeemedEvent.parameters.push( - new ethereum.EventParam("amount", ethereum.Value.fromUnsignedBigInt(amount)) - ) - unlockRedeemedEvent.parameters.push( - new ethereum.EventParam("reward", ethereum.Value.fromUnsignedBigInt(reward)) - ) - unlockRedeemedEvent.parameters.push( - new ethereum.EventParam("lpFees", ethereum.Value.fromUnsignedBigInt(lpFees)) - ) + unlockRedeemedEvent.parameters.push(new ethereum.EventParam('relayer', ethereum.Value.fromAddress(relayer))) + unlockRedeemedEvent.parameters.push(new ethereum.EventParam('tokenId', ethereum.Value.fromUnsignedBigInt(tokenId))) + unlockRedeemedEvent.parameters.push(new ethereum.EventParam('amount', ethereum.Value.fromUnsignedBigInt(amount))) + unlockRedeemedEvent.parameters.push(new ethereum.EventParam('reward', ethereum.Value.fromUnsignedBigInt(reward))) + unlockRedeemedEvent.parameters.push(new ethereum.EventParam('lpFees', ethereum.Value.fromUnsignedBigInt(lpFees))) return unlockRedeemedEvent } @@ -301,44 +190,22 @@ export function createUpgradedEvent(implementation: Address): Upgraded { upgradedEvent.parameters = new Array() - upgradedEvent.parameters.push( - new ethereum.EventParam( - "implementation", - ethereum.Value.fromAddress(implementation) - ) - ) + upgradedEvent.parameters.push(new ethereum.EventParam('implementation', ethereum.Value.fromAddress(implementation))) return upgradedEvent } -export function createWithdrawEvent( - to: Address, - amount: BigInt, - lpSharesBurnt: BigInt, - requestId: BigInt -): Withdraw { +export function createWithdrawEvent(to: Address, amount: BigInt, lpSharesBurnt: BigInt, requestId: BigInt): Withdraw { let withdrawEvent = changetype(newMockEvent()) withdrawEvent.parameters = new Array() + withdrawEvent.parameters.push(new ethereum.EventParam('to', ethereum.Value.fromAddress(to))) + withdrawEvent.parameters.push(new ethereum.EventParam('amount', ethereum.Value.fromUnsignedBigInt(amount))) withdrawEvent.parameters.push( - new ethereum.EventParam("to", ethereum.Value.fromAddress(to)) - ) - withdrawEvent.parameters.push( - new ethereum.EventParam("amount", ethereum.Value.fromUnsignedBigInt(amount)) - ) - withdrawEvent.parameters.push( - new ethereum.EventParam( - "lpSharesBurnt", - ethereum.Value.fromUnsignedBigInt(lpSharesBurnt) - ) - ) - withdrawEvent.parameters.push( - new ethereum.EventParam( - "requestId", - ethereum.Value.fromUnsignedBigInt(requestId) - ) + new ethereum.EventParam('lpSharesBurnt', ethereum.Value.fromUnsignedBigInt(lpSharesBurnt)) ) + withdrawEvent.parameters.push(new ethereum.EventParam('requestId', ethereum.Value.fromUnsignedBigInt(requestId))) return withdrawEvent } diff --git a/packages/subgraph/tests/lp-eth.test.ts b/packages/subgraph/tests/lp-eth.test.ts index 23fdf89..e6e55d3 100644 --- a/packages/subgraph/tests/lp-eth.test.ts +++ b/packages/subgraph/tests/lp-eth.test.ts @@ -1,80 +1,45 @@ -import { Address, BigInt } from "@graphprotocol/graph-ts"; -import { - afterAll, - assert, - beforeAll, - clearStore, - describe, - test, -} from "matchstick-as/assembly/index"; -import { handleBatchUnlockBought } from "../packages/subgraph/src/lp-eth"; -import { createBatchUnlockBoughtEvent } from "./lp-eth-utils"; +import { Address, BigInt } from '@graphprotocol/graph-ts' +import { afterAll, assert, beforeAll, clearStore, describe, test } from 'matchstick-as/assembly/index' +import { handleBatchUnlockBought } from '../packages/subgraph/src/lp-eth' +import { createBatchUnlockBoughtEvent } from './lp-eth-utils' // Tests structure (matchstick-as >=0.5.0) // https://thegraph.com/docs/en/developer/matchstick/#tests-structure-0-5-0 -describe("Describe entity assertions", () => { +describe('Describe entity assertions', () => { beforeAll(() => { - let caller = Address.fromString( - "0x0000000000000000000000000000000000000001" - ); - let amount = BigInt.fromI32(234); - let reward = BigInt.fromI32(234); - let lpFees = BigInt.fromI32(234); - let tokenIds = [BigInt.fromI32(234)]; - let newBatchUnlockBoughtEvent = createBatchUnlockBoughtEvent( - caller, - amount, - reward, - lpFees, - tokenIds - ); - handleBatchUnlockBought(newBatchUnlockBoughtEvent); - }); + let caller = Address.fromString('0x0000000000000000000000000000000000000001') + let amount = BigInt.fromI32(234) + let reward = BigInt.fromI32(234) + let lpFees = BigInt.fromI32(234) + let tokenIds = [BigInt.fromI32(234)] + let newBatchUnlockBoughtEvent = createBatchUnlockBoughtEvent(caller, amount, reward, lpFees, tokenIds) + handleBatchUnlockBought(newBatchUnlockBoughtEvent) + }) afterAll(() => { - clearStore(); - }); + clearStore() + }) // For more test scenarios, see: // https://thegraph.com/docs/en/developer/matchstick/#write-a-unit-test - test("BatchUnlockBought created and stored", () => { - assert.entityCount("BatchUnlockBought", 1); + test('BatchUnlockBought created and stored', () => { + assert.entityCount('BatchUnlockBought', 1) // 0xa16081f360e3847006db660bae1c6d1b2e17ec2a is the default address used in newMockEvent() function assert.fieldEquals( - "BatchUnlockBought", - "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", - "caller", - "0x0000000000000000000000000000000000000001" - ); - assert.fieldEquals( - "BatchUnlockBought", - "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", - "amount", - "234" - ); - assert.fieldEquals( - "BatchUnlockBought", - "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", - "reward", - "234" - ); - assert.fieldEquals( - "BatchUnlockBought", - "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", - "lpFees", - "234" - ); - assert.fieldEquals( - "BatchUnlockBought", - "0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1", - "tokenIds", - "[234]" - ); + 'BatchUnlockBought', + '0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1', + 'caller', + '0x0000000000000000000000000000000000000001' + ) + assert.fieldEquals('BatchUnlockBought', '0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1', 'amount', '234') + assert.fieldEquals('BatchUnlockBought', '0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1', 'reward', '234') + assert.fieldEquals('BatchUnlockBought', '0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1', 'lpFees', '234') + assert.fieldEquals('BatchUnlockBought', '0xa16081f360e3847006db660bae1c6d1b2e17ec2a-1', 'tokenIds', '[234]') // More assert options: // https://thegraph.com/docs/en/developer/matchstick/#asserts - }); -}); + }) +})