2024-03-14 06:26:15 +00:00
|
|
|
//
|
|
|
|
// Copyright 2021 Vulcanize, Inc.
|
|
|
|
//
|
|
|
|
|
|
|
|
import assert from 'assert';
|
|
|
|
import debug from 'debug';
|
|
|
|
import { GraphQLResolveInfo } from 'graphql';
|
|
|
|
|
|
|
|
import {
|
|
|
|
gqlTotalQueryCount,
|
|
|
|
gqlQueryCount,
|
|
|
|
getResultState,
|
|
|
|
IndexerInterface,
|
|
|
|
GraphQLBigInt,
|
|
|
|
GraphQLBigDecimal,
|
|
|
|
BlockHeight,
|
|
|
|
OrderDirection,
|
|
|
|
jsonBigIntStringReplacer,
|
|
|
|
EventWatcher,
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
setGQLCacheHints
|
|
|
|
} from '@cerc-io/util';
|
|
|
|
|
|
|
|
import { Indexer } from './indexer';
|
|
|
|
|
|
|
|
import { Token } from './entity/Token';
|
|
|
|
import { PoolFactory } from './entity/PoolFactory';
|
|
|
|
import { Pool } from './entity/Pool';
|
|
|
|
import { Bucket } from './entity/Bucket';
|
|
|
|
import { Lend } from './entity/Lend';
|
|
|
|
import { Loan } from './entity/Loan';
|
|
|
|
import { Account } from './entity/Account';
|
|
|
|
import { LiquidationAuction } from './entity/LiquidationAuction';
|
|
|
|
import { ReserveAuction } from './entity/ReserveAuction';
|
|
|
|
import { LPTransferorList } from './entity/LPTransferorList';
|
|
|
|
import { LPAllowance } from './entity/LPAllowance';
|
|
|
|
import { LPAllowanceList } from './entity/LPAllowanceList';
|
|
|
|
import { AddCollateral } from './entity/AddCollateral';
|
|
|
|
import { AddQuoteToken } from './entity/AddQuoteToken';
|
|
|
|
import { AuctionSettle } from './entity/AuctionSettle';
|
|
|
|
import { BondWithdrawn } from './entity/BondWithdrawn';
|
|
|
|
import { BucketBankruptcy } from './entity/BucketBankruptcy';
|
|
|
|
import { BucketTake } from './entity/BucketTake';
|
|
|
|
import { BucketTakeLPAwarded } from './entity/BucketTakeLPAwarded';
|
|
|
|
import { DrawDebt } from './entity/DrawDebt';
|
|
|
|
import { Flashloan } from './entity/Flashloan';
|
|
|
|
import { Kick } from './entity/Kick';
|
|
|
|
import { LoanStamped } from './entity/LoanStamped';
|
|
|
|
import { MoveQuoteToken } from './entity/MoveQuoteToken';
|
|
|
|
import { RemoveCollateral } from './entity/RemoveCollateral';
|
|
|
|
import { RemoveQuoteToken } from './entity/RemoveQuoteToken';
|
|
|
|
import { RepayDebt } from './entity/RepayDebt';
|
|
|
|
import { ReserveAuctionKick } from './entity/ReserveAuctionKick';
|
|
|
|
import { ReserveAuctionTake } from './entity/ReserveAuctionTake';
|
|
|
|
import { ResetInterestRate } from './entity/ResetInterestRate';
|
|
|
|
import { Settle } from './entity/Settle';
|
|
|
|
import { Take } from './entity/Take';
|
|
|
|
import { TransferLP } from './entity/TransferLP';
|
|
|
|
import { UpdateInterestRate } from './entity/UpdateInterestRate';
|
|
|
|
import { Approval } from './entity/Approval';
|
|
|
|
import { ApprovalForAll } from './entity/ApprovalForAll';
|
|
|
|
import { MoveLiquidity } from './entity/MoveLiquidity';
|
|
|
|
import { Transfer } from './entity/Transfer';
|
|
|
|
import { PoolCreated } from './entity/PoolCreated';
|
|
|
|
import { AddCollateralNFT } from './entity/AddCollateralNFT';
|
|
|
|
import { AuctionNFTSettle } from './entity/AuctionNFTSettle';
|
|
|
|
import { DrawDebtNFT } from './entity/DrawDebtNFT';
|
|
|
|
import { MergeOrRemoveCollateralNFT } from './entity/MergeOrRemoveCollateralNFT';
|
|
|
|
import { Position } from './entity/Position';
|
|
|
|
import { PositionLend } from './entity/PositionLend';
|
|
|
|
import { Burn } from './entity/Burn';
|
|
|
|
import { MemorializePosition } from './entity/MemorializePosition';
|
|
|
|
import { Mint } from './entity/Mint';
|
|
|
|
import { RedeemPosition } from './entity/RedeemPosition';
|
|
|
|
import { GrantFund } from './entity/GrantFund';
|
|
|
|
import { DistributionPeriod } from './entity/DistributionPeriod';
|
|
|
|
import { Proposal } from './entity/Proposal';
|
|
|
|
import { ProposalParams } from './entity/ProposalParams';
|
|
|
|
import { DistributionPeriodVote } from './entity/DistributionPeriodVote';
|
|
|
|
import { ScreeningVote } from './entity/ScreeningVote';
|
|
|
|
import { FundingVote } from './entity/FundingVote';
|
|
|
|
import { FundedSlate } from './entity/FundedSlate';
|
|
|
|
import { DelegateRewardClaimed } from './entity/DelegateRewardClaimed';
|
|
|
|
import { FundTreasury } from './entity/FundTreasury';
|
|
|
|
import { FundedSlateUpdated } from './entity/FundedSlateUpdated';
|
|
|
|
import { ProposalCreated } from './entity/ProposalCreated';
|
|
|
|
import { ProposalExecuted } from './entity/ProposalExecuted';
|
|
|
|
import { DistributionPeriodStarted } from './entity/DistributionPeriodStarted';
|
|
|
|
import { VoteCast } from './entity/VoteCast';
|
|
|
|
import { DelegateChanged } from './entity/DelegateChanged';
|
|
|
|
import { DelegateVotesChanged } from './entity/DelegateVotesChanged';
|
|
|
|
import { BurnWrap } from './entity/BurnWrap';
|
|
|
|
|
|
|
|
const log = debug('vulcanize:resolver');
|
|
|
|
|
|
|
|
export const createResolvers = async (indexerArg: IndexerInterface, eventWatcher: EventWatcher): Promise<any> => {
|
|
|
|
const indexer = indexerArg as Indexer;
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
|
const gqlCacheConfig = indexer.serverConfig.gqlCache;
|
|
|
|
|
|
|
|
return {
|
|
|
|
BigInt: GraphQLBigInt,
|
|
|
|
|
|
|
|
BigDecimal: GraphQLBigDecimal,
|
|
|
|
|
|
|
|
Event: {
|
|
|
|
__resolveType: (obj: any) => {
|
|
|
|
assert(obj.__typename);
|
|
|
|
|
|
|
|
return obj.__typename;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Subscription: {
|
|
|
|
onEvent: {
|
|
|
|
subscribe: () => eventWatcher.getEventIterator()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Mutation: {
|
|
|
|
watchContract: async (_: any, { address, kind, checkpoint, startingBlock = 1 }: { address: string, kind: string, checkpoint: boolean, startingBlock: number }): Promise<boolean> => {
|
|
|
|
log('watchContract', address, kind, checkpoint, startingBlock);
|
|
|
|
await indexer.watchContract(address, kind, checkpoint, startingBlock);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
Query: {
|
|
|
|
token: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('token', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('token').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Token, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
tokens: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('tokens', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('tokens').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Token,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
poolFactory: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('poolFactory', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('poolFactory').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(PoolFactory, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
poolFactories: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('poolFactories', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('poolFactories').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
PoolFactory,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
pool: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('pool', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('pool').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Pool, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
pools: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('pools', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('pools').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Pool,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
bucket: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bucket', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bucket').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Bucket, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
buckets: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('buckets', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('buckets').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Bucket,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
lend: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lend', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lend').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Lend, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
lends: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lends', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lends').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Lend,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
loan: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('loan', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('loan').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Loan, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
loans: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('loans', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('loans').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Loan,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
account: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('account', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('account').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Account, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
accounts: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('accounts', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('accounts').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Account,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
liquidationAuction: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('liquidationAuction', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('liquidationAuction').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(LiquidationAuction, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
liquidationAuctions: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('liquidationAuctions', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('liquidationAuctions').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
LiquidationAuction,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
reserveAuction: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('reserveAuction', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('reserveAuction').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ReserveAuction, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
reserveAuctions: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('reserveAuctions', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('reserveAuctions').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ReserveAuction,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
lptransferorList: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lptransferorList', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lptransferorList').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(LPTransferorList, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
lptransferorLists: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lptransferorLists', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lptransferorLists').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
LPTransferorList,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
lpallowance: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lpallowance', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lpallowance').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(LPAllowance, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
lpallowances: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lpallowances', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lpallowances').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
LPAllowance,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
lpallowanceList: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lpallowanceList', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lpallowanceList').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(LPAllowanceList, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
lpallowanceLists: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('lpallowanceLists', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('lpallowanceLists').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
LPAllowanceList,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
addCollateral: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('addCollateral', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('addCollateral').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(AddCollateral, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
addCollaterals: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('addCollaterals', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('addCollaterals').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
AddCollateral,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
addQuoteToken: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('addQuoteToken', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('addQuoteToken').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(AddQuoteToken, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
addQuoteTokens: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('addQuoteTokens', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('addQuoteTokens').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
AddQuoteToken,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
auctionSettle: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('auctionSettle', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('auctionSettle').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(AuctionSettle, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
auctionSettles: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('auctionSettles', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('auctionSettles').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
AuctionSettle,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
bondWithdrawn: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bondWithdrawn', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bondWithdrawn').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(BondWithdrawn, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
bondWithdrawns: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bondWithdrawns', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bondWithdrawns').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
BondWithdrawn,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
bucketBankruptcy: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bucketBankruptcy', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bucketBankruptcy').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(BucketBankruptcy, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
bucketBankruptcies: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bucketBankruptcies', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bucketBankruptcies').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
BucketBankruptcy,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
bucketTake: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bucketTake', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bucketTake').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(BucketTake, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
bucketTakes: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bucketTakes', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bucketTakes').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
BucketTake,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
bucketTakeLPAwarded: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bucketTakeLPAwarded', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bucketTakeLPAwarded').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(BucketTakeLPAwarded, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
bucketTakeLPAwardeds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('bucketTakeLPAwardeds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('bucketTakeLPAwardeds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
BucketTakeLPAwarded,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
drawDebt: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('drawDebt', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('drawDebt').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DrawDebt, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
drawDebts: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('drawDebts', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('drawDebts').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DrawDebt,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
flashloan: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('flashloan', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('flashloan').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Flashloan, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
flashloans: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('flashloans', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('flashloans').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Flashloan,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
kick: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('kick', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('kick').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Kick, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
kicks: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('kicks', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('kicks').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Kick,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
loanStamped: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('loanStamped', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('loanStamped').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(LoanStamped, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
loanStampeds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('loanStampeds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('loanStampeds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
LoanStamped,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
moveQuoteToken: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('moveQuoteToken', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('moveQuoteToken').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(MoveQuoteToken, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
moveQuoteTokens: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('moveQuoteTokens', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('moveQuoteTokens').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
MoveQuoteToken,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
removeCollateral: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('removeCollateral', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('removeCollateral').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(RemoveCollateral, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
removeCollaterals: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('removeCollaterals', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('removeCollaterals').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
RemoveCollateral,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
removeQuoteToken: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('removeQuoteToken', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('removeQuoteToken').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(RemoveQuoteToken, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
removeQuoteTokens: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('removeQuoteTokens', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('removeQuoteTokens').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
RemoveQuoteToken,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
repayDebt: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('repayDebt', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('repayDebt').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(RepayDebt, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
repayDebts: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('repayDebts', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('repayDebts').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
RepayDebt,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
reserveAuctionKick: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('reserveAuctionKick', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('reserveAuctionKick').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ReserveAuctionKick, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
reserveAuctionKicks: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('reserveAuctionKicks', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('reserveAuctionKicks').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ReserveAuctionKick,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
reserveAuctionTake: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('reserveAuctionTake', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('reserveAuctionTake').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ReserveAuctionTake, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
reserveAuctionTakes: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('reserveAuctionTakes', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('reserveAuctionTakes').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ReserveAuctionTake,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
resetInterestRate: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('resetInterestRate', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('resetInterestRate').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ResetInterestRate, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
resetInterestRates: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('resetInterestRates', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('resetInterestRates').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ResetInterestRate,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
settle: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('settle', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('settle').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Settle, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
settles: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('settles', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('settles').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Settle,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
take: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('take', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('take').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Take, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
takes: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('takes', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('takes').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Take,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
transferLP: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('transferLP', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('transferLP').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(TransferLP, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
transferLPS: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('transferLPS', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('transferLPS').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
TransferLP,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
updateInterestRate: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('updateInterestRate', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('updateInterestRate').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(UpdateInterestRate, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
updateInterestRates: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('updateInterestRates', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('updateInterestRates').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
UpdateInterestRate,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
approval: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('approval', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('approval').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Approval, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
approvals: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('approvals', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('approvals').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Approval,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
approvalForAll: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('approvalForAll', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('approvalForAll').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ApprovalForAll, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
approvalForAlls: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('approvalForAlls', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('approvalForAlls').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ApprovalForAll,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
moveLiquidity: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('moveLiquidity', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('moveLiquidity').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(MoveLiquidity, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
moveLiquidities: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('moveLiquidities', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('moveLiquidities').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
MoveLiquidity,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
transfer: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('transfer', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('transfer').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Transfer, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
transfers: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('transfers', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('transfers').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Transfer,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
poolCreated: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('poolCreated', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('poolCreated').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(PoolCreated, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
poolCreateds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('poolCreateds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('poolCreateds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
PoolCreated,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
addCollateralNFT: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('addCollateralNFT', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('addCollateralNFT').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(AddCollateralNFT, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
addCollateralNFTS: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('addCollateralNFTS', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('addCollateralNFTS').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
AddCollateralNFT,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
auctionNFTSettle: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('auctionNFTSettle', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('auctionNFTSettle').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(AuctionNFTSettle, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
auctionNFTSettles: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('auctionNFTSettles', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('auctionNFTSettles').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
AuctionNFTSettle,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
drawDebtNFT: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('drawDebtNFT', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('drawDebtNFT').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DrawDebtNFT, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
drawDebtNFTS: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('drawDebtNFTS', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('drawDebtNFTS').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DrawDebtNFT,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
mergeOrRemoveCollateralNFT: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('mergeOrRemoveCollateralNFT', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('mergeOrRemoveCollateralNFT').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(MergeOrRemoveCollateralNFT, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
mergeOrRemoveCollateralNFTS: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('mergeOrRemoveCollateralNFTS', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('mergeOrRemoveCollateralNFTS').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
MergeOrRemoveCollateralNFT,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
position: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('position', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('position').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Position, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
positions: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('positions', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('positions').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Position,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
positionLend: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('positionLend', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('positionLend').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(PositionLend, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
positionLends: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('positionLends', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('positionLends').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
PositionLend,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
burn: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('burn', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('burn').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Burn, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
burns: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('burns', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('burns').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Burn,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
memorializePosition: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('memorializePosition', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('memorializePosition').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(MemorializePosition, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
memorializePositions: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('memorializePositions', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('memorializePositions').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
MemorializePosition,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
mint: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('mint', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('mint').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Mint, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
mints: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('mints', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('mints').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Mint,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
redeemPosition: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('redeemPosition', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('redeemPosition').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(RedeemPosition, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
redeemPositions: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('redeemPositions', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('redeemPositions').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
RedeemPosition,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
grantFund: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('grantFund', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('grantFund').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(GrantFund, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
grantFunds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('grantFunds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('grantFunds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
GrantFund,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
distributionPeriod: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('distributionPeriod', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('distributionPeriod').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DistributionPeriod, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
distributionPeriods: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('distributionPeriods', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('distributionPeriods').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DistributionPeriod,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
proposal: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposal', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposal').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(Proposal, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
proposals: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposals', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposals').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
Proposal,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
proposalParams: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposalParams', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposalParams').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ProposalParams, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
proposalParamss: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposalParamss', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposalParamss').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ProposalParams,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
distributionPeriodVote: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('distributionPeriodVote', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('distributionPeriodVote').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DistributionPeriodVote, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
distributionPeriodVotes: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('distributionPeriodVotes', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('distributionPeriodVotes').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DistributionPeriodVote,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
screeningVote: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('screeningVote', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('screeningVote').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ScreeningVote, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
screeningVotes: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('screeningVotes', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('screeningVotes').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ScreeningVote,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
fundingVote: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundingVote', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundingVote').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(FundingVote, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
fundingVotes: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundingVotes', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundingVotes').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
FundingVote,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
fundedSlate: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundedSlate', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundedSlate').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(FundedSlate, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
fundedSlates: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundedSlates', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundedSlates').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
FundedSlate,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
delegateRewardClaimed: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('delegateRewardClaimed', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('delegateRewardClaimed').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DelegateRewardClaimed, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
delegateRewardClaimeds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('delegateRewardClaimeds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('delegateRewardClaimeds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DelegateRewardClaimed,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
fundTreasury: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundTreasury', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundTreasury').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(FundTreasury, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
fundTreasuries: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundTreasuries', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundTreasuries').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
FundTreasury,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
fundedSlateUpdated: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundedSlateUpdated', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundedSlateUpdated').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(FundedSlateUpdated, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
fundedSlateUpdateds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('fundedSlateUpdateds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('fundedSlateUpdateds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
FundedSlateUpdated,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
proposalCreated: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposalCreated', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposalCreated').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ProposalCreated, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
proposalCreateds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposalCreateds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposalCreateds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ProposalCreated,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
proposalExecuted: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposalExecuted', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposalExecuted').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(ProposalExecuted, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
proposalExecuteds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('proposalExecuteds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('proposalExecuteds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
ProposalExecuted,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
distributionPeriodStarted: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('distributionPeriodStarted', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('distributionPeriodStarted').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DistributionPeriodStarted, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
distributionPeriodStarteds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('distributionPeriodStarteds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('distributionPeriodStarteds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DistributionPeriodStarted,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
voteCast: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('voteCast', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('voteCast').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(VoteCast, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
voteCasts: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('voteCasts', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('voteCasts').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
VoteCast,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
delegateChanged: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('delegateChanged', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('delegateChanged').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DelegateChanged, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
delegateChangeds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('delegateChangeds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('delegateChangeds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DelegateChanged,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
delegateVotesChanged: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('delegateVotesChanged', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('delegateVotesChanged').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(DelegateVotesChanged, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
delegateVotesChangeds: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('delegateVotesChangeds', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('delegateVotesChangeds').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
DelegateVotesChanged,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
burnWrap: async (
|
|
|
|
_: any,
|
|
|
|
{ id, block = {} }: { id: string, block: BlockHeight },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('burnWrap', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('burnWrap').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
2024-05-17 11:58:02 +00:00
|
|
|
return indexer.getSubgraphEntity(BurnWrap, id, block, info);
|
2024-03-14 06:26:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
burnWraps: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
|
|
|
__: any,
|
|
|
|
info: GraphQLResolveInfo
|
|
|
|
) => {
|
|
|
|
log('burnWraps', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('burnWraps').inc(1);
|
|
|
|
|
|
|
|
// Set cache-control hints
|
|
|
|
// setGQLCacheHints(info, block, gqlCacheConfig);
|
|
|
|
|
|
|
|
return indexer.getSubgraphEntities(
|
|
|
|
BurnWrap,
|
|
|
|
block,
|
|
|
|
where,
|
|
|
|
{ limit: first, skip, orderBy, orderDirection },
|
2024-05-17 11:58:02 +00:00
|
|
|
info
|
2024-03-14 06:26:15 +00:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
events: async (_: any, { blockHash, contractAddress, name }: { blockHash: string, contractAddress: string, name?: string }) => {
|
|
|
|
log('events', blockHash, contractAddress, name);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('events').inc(1);
|
|
|
|
|
|
|
|
const block = await indexer.getBlockProgress(blockHash);
|
|
|
|
if (!block || !block.isComplete) {
|
|
|
|
throw new Error(`Block hash ${blockHash} number ${block?.blockNumber} not processed yet`);
|
|
|
|
}
|
|
|
|
|
|
|
|
const events = await indexer.getEventsByFilter(blockHash, contractAddress, name);
|
|
|
|
return events.map(event => indexer.getResultEvent(event));
|
|
|
|
},
|
|
|
|
|
|
|
|
eventsInRange: async (_: any, { fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number }) => {
|
|
|
|
log('eventsInRange', fromBlockNumber, toBlockNumber);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('eventsInRange').inc(1);
|
|
|
|
|
|
|
|
const syncStatus = await indexer.getSyncStatus();
|
|
|
|
|
|
|
|
if (!syncStatus) {
|
|
|
|
throw new Error('No blocks processed yet');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((fromBlockNumber < syncStatus.initialIndexedBlockNumber) || (toBlockNumber > syncStatus.latestProcessedBlockNumber)) {
|
|
|
|
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
|
|
|
|
return events.map(event => indexer.getResultEvent(event));
|
|
|
|
},
|
|
|
|
|
|
|
|
getStateByCID: async (_: any, { cid }: { cid: string }) => {
|
|
|
|
log('getStateByCID', cid);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('getStateByCID').inc(1);
|
|
|
|
|
|
|
|
const state = await indexer.getStateByCID(cid);
|
|
|
|
|
|
|
|
return state && state.block.isComplete ? getResultState(state) : undefined;
|
|
|
|
},
|
|
|
|
|
|
|
|
getState: async (_: any, { blockHash, contractAddress, kind }: { blockHash: string, contractAddress: string, kind: string }) => {
|
|
|
|
log('getState', blockHash, contractAddress, kind);
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('getState').inc(1);
|
|
|
|
|
|
|
|
const state = await indexer.getPrevState(blockHash, contractAddress, kind);
|
|
|
|
|
|
|
|
return state && state.block.isComplete ? getResultState(state) : undefined;
|
|
|
|
},
|
|
|
|
|
|
|
|
_meta: async (
|
|
|
|
_: any,
|
|
|
|
{ block = {} }: { block: BlockHeight }
|
|
|
|
) => {
|
|
|
|
log('_meta');
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('_meta').inc(1);
|
|
|
|
|
|
|
|
return indexer.getMetaData(block);
|
|
|
|
},
|
|
|
|
|
|
|
|
getSyncStatus: async () => {
|
|
|
|
log('getSyncStatus');
|
|
|
|
gqlTotalQueryCount.inc(1);
|
|
|
|
gqlQueryCount.labels('getSyncStatus').inc(1);
|
|
|
|
|
|
|
|
return indexer.getSyncStatus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|