Regenerate watcher with latest watcher-ts and subgraph (#2)
Part of [Generate secured-finance subgraph watcher with codegen](https://www.notion.so/Generate-secured-finance-subgraph-watcher-with-codegen-2923413e0af54ea787c5435d6966f3bb) Reviewed-on: #2 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
parent
0eb30a818a
commit
7d04a5eda1
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,3 +4,5 @@ out/
|
||||
|
||||
.vscode
|
||||
.idea
|
||||
|
||||
gql-logs/
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
## Source
|
||||
|
||||
* Subgraph: [secured-finance-subgraph v0.1.0](https://github.com/cerc-io/secured-finance-subgraph/releases/tag/v0.1.0)
|
||||
* Subgraph: [secured-finance-subgraph v0.1.1](https://github.com/cerc-io/secured-finance-subgraph/releases/tag/v0.1.1)
|
||||
|
||||
## Setup
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
To enable GQL requests caching:
|
||||
|
||||
* Update the `server.gqlCache` config with required settings.
|
||||
* Update the `server.gql.cache` config with required settings.
|
||||
|
||||
* In the GQL [schema file](./src/schema.gql), use the `cacheControl` directive to apply cache hints at schema level.
|
||||
|
||||
|
23
codegen-config.yml
Normal file
23
codegen-config.yml
Normal file
@ -0,0 +1,23 @@
|
||||
# Contracts to watch (required).
|
||||
# Can pass empty array ([]) when using subgraphPath.
|
||||
contracts: []
|
||||
|
||||
# Output folder path (logs output using `stdout` if not provided).
|
||||
outputFolder: /home/user/cerc-io/secured-finance/secured-finance-watcher-ts
|
||||
|
||||
# Code generation mode [eth_call | storage | all | none] (default: none).
|
||||
mode: none
|
||||
|
||||
# Kind of watcher [lazy | active] (default: active).
|
||||
kind: active
|
||||
|
||||
# Watcher server port (default: 3008).
|
||||
port: 3008
|
||||
|
||||
# Flatten the input contract file(s) [true | false] (default: true).
|
||||
flatten: true
|
||||
|
||||
# Config for subgraph
|
||||
subgraph:
|
||||
# Network configuration to use from the networks config file (optional)
|
||||
buildPath: /home/user/cerc-io/secured-finance/secured-finance-subgraph/build
|
@ -2,7 +2,6 @@
|
||||
host = "127.0.0.1"
|
||||
port = 3008
|
||||
kind = "active"
|
||||
gqlPath = "/graphql"
|
||||
|
||||
# Checkpointing state.
|
||||
checkpointing = true
|
||||
@ -11,8 +10,7 @@
|
||||
checkpointInterval = 2000
|
||||
|
||||
# Enable state creation
|
||||
# CAUTION: Disable only if state creation is not desired or can be filled subsequently
|
||||
enableState = true
|
||||
enableState = false
|
||||
|
||||
subgraphPath = "./subgraph-build"
|
||||
|
||||
@ -22,23 +20,30 @@
|
||||
# Interval in number of blocks at which to clear entities cache.
|
||||
clearEntitiesCacheInterval = 1000
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
|
||||
# Flag to specify whether RPC endpoint supports block hash as block tag parameter
|
||||
rpcSupportsBlockHashParam = true
|
||||
rpcSupportsBlockHashParam = false
|
||||
|
||||
# GQL cache settings
|
||||
[server.gqlCache]
|
||||
enabled = true
|
||||
# Server GQL config
|
||||
[server.gql]
|
||||
path = "/graphql"
|
||||
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
# Log directory for GQL requests
|
||||
logDir = "./gql-logs"
|
||||
|
||||
# GQL cache settings
|
||||
[server.gql.cache]
|
||||
enabled = true
|
||||
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
|
||||
[metrics]
|
||||
host = "127.0.0.1"
|
||||
@ -58,7 +63,6 @@
|
||||
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
gqlApiEndpoint = "http://127.0.0.1:8082/graphql"
|
||||
rpcProviderEndpoints = [
|
||||
"http://127.0.0.1:8081"
|
||||
]
|
||||
@ -87,6 +91,9 @@
|
||||
subgraphEventsOrder = true
|
||||
blockDelayInMilliSecs = 30000
|
||||
|
||||
# Number of blocks by which block processing lags behind head
|
||||
blockProcessingOffset = 0
|
||||
|
||||
# Boolean to switch between modes of processing events when starting the server.
|
||||
# Setting to true will fetch filtered events and required blocks in a range of blocks and then process them.
|
||||
# Setting to false will fetch blocks consecutively with its events and then process them (Behaviour is followed in realtime processing near head).
|
||||
|
17
package.json
17
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/secured-finance-watcher-ts",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "secured-finance-watcher-ts",
|
||||
"private": true,
|
||||
"main": "dist/index.js",
|
||||
@ -29,7 +29,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/cerc-io/watcher-ts.git"
|
||||
"url": "https://git.vdb.to/cerc-io/secured-finance-watcher-ts"
|
||||
},
|
||||
"author": "",
|
||||
"license": "AGPL-3.0",
|
||||
@ -39,11 +39,11 @@
|
||||
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.3.19",
|
||||
"@cerc-io/cli": "^0.2.90",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.90",
|
||||
"@cerc-io/solidity-mapper": "^0.2.90",
|
||||
"@cerc-io/util": "^0.2.90",
|
||||
"@cerc-io/graph-node": "^0.2.90",
|
||||
"@cerc-io/cli": "^0.2.98",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.98",
|
||||
"@cerc-io/solidity-mapper": "^0.2.98",
|
||||
"@cerc-io/util": "^0.2.98",
|
||||
"@cerc-io/graph-node": "^0.2.98",
|
||||
"@ethersproject/providers": "^5.4.4",
|
||||
"debug": "^4.3.1",
|
||||
"decimal.js": "^10.3.1",
|
||||
@ -71,6 +71,7 @@
|
||||
"eslint-plugin-standard": "^5.0.0",
|
||||
"husky": "^7.0.2",
|
||||
"ts-node": "^10.2.1",
|
||||
"typescript": "^5.0.2"
|
||||
"typescript": "^5.0.2",
|
||||
"winston": "^3.13.0"
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,6 @@ query events($blockHash: String!, $contractAddress: String!, $name: String){
|
||||
contract
|
||||
eventIndex
|
||||
event{
|
||||
... on TestEvent {
|
||||
param1
|
||||
param2
|
||||
param3
|
||||
}
|
||||
... on EmergencyTerminationExecutedEvent {
|
||||
timestamp
|
||||
}
|
||||
|
@ -16,11 +16,6 @@ query eventsInRange($fromBlockNumber: Int!, $toBlockNumber: Int!){
|
||||
contract
|
||||
eventIndex
|
||||
event{
|
||||
... on TestEvent {
|
||||
param1
|
||||
param2
|
||||
param3
|
||||
}
|
||||
... on EmergencyTerminationExecutedEvent {
|
||||
timestamp
|
||||
}
|
||||
|
@ -16,11 +16,6 @@ subscription onEvent{
|
||||
contract
|
||||
eventIndex
|
||||
event{
|
||||
... on TestEvent {
|
||||
param1
|
||||
param2
|
||||
param3
|
||||
}
|
||||
... on EmergencyTerminationExecutedEvent {
|
||||
timestamp
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ import {
|
||||
} from '@cerc-io/util';
|
||||
import { GraphWatcher } from '@cerc-io/graph-node';
|
||||
|
||||
import ExampleArtifacts from './artifacts/Example.json';
|
||||
import LendingMarketOperationLogicArtifacts from './artifacts/LendingMarketOperationLogic.json';
|
||||
import TokenVaultArtifacts from './artifacts/TokenVault.json';
|
||||
import FundManagementLogicArtifacts from './artifacts/FundManagementLogic.json';
|
||||
@ -71,8 +70,6 @@ import { FrothyEntity } from './entity/FrothyEntity';
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const log = debug('vulcanize:indexer');
|
||||
|
||||
const KIND_EXAMPLE = 'Example1';
|
||||
|
||||
const KIND_LENDINGMARKETOPERATIONLOGIC = 'LendingMarketOperationLogic';
|
||||
|
||||
const KIND_TOKENVAULT = 'TokenVault';
|
||||
@ -132,8 +129,6 @@ export class Indexer implements IndexerInterface {
|
||||
this._contractMap = new Map();
|
||||
this.eventSignaturesMap = new Map();
|
||||
|
||||
const { abi: ExampleABI, storageLayout: ExampleStorageLayout } = ExampleArtifacts;
|
||||
|
||||
const { abi: LendingMarketOperationLogicABI } = LendingMarketOperationLogicArtifacts;
|
||||
|
||||
const { abi: TokenVaultABI } = TokenVaultArtifacts;
|
||||
@ -146,20 +141,6 @@ export class Indexer implements IndexerInterface {
|
||||
|
||||
const { abi: OrderBookLogicABI } = OrderBookLogicArtifacts;
|
||||
|
||||
assert(ExampleABI);
|
||||
this._abiMap.set(KIND_EXAMPLE, ExampleABI);
|
||||
|
||||
const ExampleContractInterface = new ethers.utils.Interface(ExampleABI);
|
||||
this._contractMap.set(KIND_EXAMPLE, ExampleContractInterface);
|
||||
|
||||
const ExampleEventSignatures = Object.values(ExampleContractInterface.events).map(value => {
|
||||
return ExampleContractInterface.getEventTopic(value);
|
||||
});
|
||||
this.eventSignaturesMap.set(KIND_EXAMPLE, ExampleEventSignatures);
|
||||
|
||||
assert(ExampleStorageLayout);
|
||||
this._storageLayoutMap.set(KIND_EXAMPLE, ExampleStorageLayout);
|
||||
|
||||
assert(LendingMarketOperationLogicABI);
|
||||
this._abiMap.set(KIND_LENDINGMARKETOPERATIONLOGIC, LendingMarketOperationLogicABI);
|
||||
|
||||
@ -587,7 +568,7 @@ export class Indexer implements IndexerInterface {
|
||||
}
|
||||
|
||||
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
|
||||
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.maxEventsBlockRange);
|
||||
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
|
||||
}
|
||||
|
||||
async getSyncStatus (): Promise<SyncStatus | undefined> {
|
||||
|
526
src/resolvers.ts
526
src/resolvers.ts
@ -5,10 +5,13 @@
|
||||
import assert from 'assert';
|
||||
import debug from 'debug';
|
||||
import { GraphQLResolveInfo } from 'graphql';
|
||||
import { ExpressContext } from 'apollo-server-express';
|
||||
import winston from 'winston';
|
||||
|
||||
import {
|
||||
gqlTotalQueryCount,
|
||||
gqlQueryCount,
|
||||
gqlQueryDuration,
|
||||
getResultState,
|
||||
IndexerInterface,
|
||||
GraphQLBigInt,
|
||||
@ -36,11 +39,59 @@ import { TransactionCandleStick } from './entity/TransactionCandleStick';
|
||||
|
||||
const log = debug('vulcanize:resolver');
|
||||
|
||||
export const createResolvers = async (indexerArg: IndexerInterface, eventWatcher: EventWatcher): Promise<any> => {
|
||||
const executeAndRecordMetrics = async (
|
||||
indexer: Indexer,
|
||||
gqlLogger: winston.Logger,
|
||||
opName: string,
|
||||
expressContext: ExpressContext,
|
||||
operation: () => Promise<any>
|
||||
) => {
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels(opName).inc(1);
|
||||
const endTimer = gqlQueryDuration.labels(opName).startTimer();
|
||||
|
||||
try {
|
||||
const [result, syncStatus] = await Promise.all([
|
||||
operation(),
|
||||
indexer.getSyncStatus()
|
||||
]);
|
||||
|
||||
gqlLogger.info({
|
||||
opName,
|
||||
query: expressContext.req.body.query,
|
||||
variables: expressContext.req.body.variables,
|
||||
latestIndexedBlockNumber: syncStatus?.latestIndexedBlockNumber,
|
||||
urlPath: expressContext.req.path,
|
||||
apiKey: expressContext.req.header('x-api-key'),
|
||||
origin: expressContext.req.headers.origin
|
||||
});
|
||||
return result;
|
||||
} catch (error) {
|
||||
gqlLogger.error({
|
||||
opName,
|
||||
error,
|
||||
query: expressContext.req.body.query,
|
||||
variables: expressContext.req.body.variables,
|
||||
urlPath: expressContext.req.path,
|
||||
apiKey: expressContext.req.header('x-api-key'),
|
||||
origin: expressContext.req.headers.origin
|
||||
});
|
||||
|
||||
throw error;
|
||||
} finally {
|
||||
endTimer();
|
||||
}
|
||||
};
|
||||
|
||||
export const createResolvers = async (
|
||||
indexerArg: IndexerInterface,
|
||||
eventWatcher: EventWatcher,
|
||||
gqlLogger: winston.Logger
|
||||
): Promise<any> => {
|
||||
const indexer = indexerArg as Indexer;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const gqlCacheConfig = indexer.serverConfig.gqlCache;
|
||||
const gqlCacheConfig = indexer.serverConfig.gql.cache;
|
||||
|
||||
return {
|
||||
BigInt: GraphQLBigInt,
|
||||
@ -74,453 +125,586 @@ export const createResolvers = async (indexerArg: IndexerInterface, eventWatcher
|
||||
transaction: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('transaction', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('transaction').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(Transaction, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'transaction',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(Transaction, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
transactions: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('transactions', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('transactions').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
Transaction,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'transactions',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
Transaction,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
order: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('order', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('order').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(Order, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'order',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(Order, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
orders: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('orders', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('orders').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
Order,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'orders',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
Order,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
lendingMarket: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('lendingMarket', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('lendingMarket').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(LendingMarket, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'lendingMarket',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(LendingMarket, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
lendingMarkets: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('lendingMarkets', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('lendingMarkets').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
LendingMarket,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'lendingMarkets',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
LendingMarket,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
user: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('user', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('user').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(User, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'user',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(User, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
users: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('users', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('users').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
User,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'users',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
User,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
dailyVolume: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('dailyVolume', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('dailyVolume').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(DailyVolume, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'dailyVolume',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(DailyVolume, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
dailyVolumes: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('dailyVolumes', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('dailyVolumes').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
DailyVolume,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'dailyVolumes',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
DailyVolume,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
protocol: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('protocol', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('protocol').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(Protocol, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'protocol',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(Protocol, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
protocols: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('protocols', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('protocols').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
Protocol,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'protocols',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
Protocol,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
liquidation: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('liquidation', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('liquidation').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(Liquidation, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'liquidation',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(Liquidation, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
liquidations: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('liquidations', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('liquidations').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
Liquidation,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'liquidations',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
Liquidation,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
transfer: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
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);
|
||||
|
||||
return indexer.getSubgraphEntity(Transfer, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'transfer',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(Transfer, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
transfers: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
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 },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'transfers',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
Transfer,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
deposit: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('deposit', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('deposit').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(Deposit, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'deposit',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(Deposit, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
deposits: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('deposits', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('deposits').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
Deposit,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'deposits',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
Deposit,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
transactionCandleStick: async (
|
||||
_: any,
|
||||
{ id, block = {} }: { id: string, block: BlockHeight },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('transactionCandleStick', id, JSON.stringify(block, jsonBigIntStringReplacer));
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('transactionCandleStick').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntity(TransactionCandleStick, id, block, info);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'transactionCandleStick',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntity(TransactionCandleStick, id, block, info)
|
||||
);
|
||||
},
|
||||
|
||||
transactionCandleSticks: async (
|
||||
_: any,
|
||||
{ block = {}, where, first, skip, orderBy, orderDirection }: { block: BlockHeight, where: { [key: string]: any }, first: number, skip: number, orderBy: string, orderDirection: OrderDirection },
|
||||
__: any,
|
||||
expressContext: ExpressContext,
|
||||
info: GraphQLResolveInfo
|
||||
) => {
|
||||
log('transactionCandleSticks', JSON.stringify(block, jsonBigIntStringReplacer), JSON.stringify(where, jsonBigIntStringReplacer), first, skip, orderBy, orderDirection);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('transactionCandleSticks').inc(1);
|
||||
|
||||
// Set cache-control hints
|
||||
// setGQLCacheHints(info, block, gqlCacheConfig);
|
||||
|
||||
return indexer.getSubgraphEntities(
|
||||
TransactionCandleStick,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'transactionCandleSticks',
|
||||
expressContext,
|
||||
async () => indexer.getSubgraphEntities(
|
||||
TransactionCandleStick,
|
||||
block,
|
||||
where,
|
||||
{ limit: first, skip, orderBy, orderDirection },
|
||||
info
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
events: async (_: any, { blockHash, contractAddress, name }: { blockHash: string, contractAddress: string, name?: string }) => {
|
||||
events: async (
|
||||
_: any,
|
||||
{ blockHash, contractAddress, name }: { blockHash: string, contractAddress: string, name?: string },
|
||||
expressContext: ExpressContext
|
||||
) => {
|
||||
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`);
|
||||
}
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'events',
|
||||
expressContext,
|
||||
async () => {
|
||||
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));
|
||||
const events = await indexer.getEventsByFilter(blockHash, contractAddress, name);
|
||||
return events.map(event => indexer.getResultEvent(event));
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
eventsInRange: async (_: any, { fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number }) => {
|
||||
eventsInRange: async (
|
||||
_: any,
|
||||
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
|
||||
expressContext: ExpressContext
|
||||
) => {
|
||||
log('eventsInRange', fromBlockNumber, toBlockNumber);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('eventsInRange').inc(1);
|
||||
|
||||
const syncStatus = await indexer.getSyncStatus();
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'eventsInRange',
|
||||
expressContext,
|
||||
async () => {
|
||||
const syncStatus = await indexer.getSyncStatus();
|
||||
|
||||
if (!syncStatus) {
|
||||
throw new Error('No blocks processed yet');
|
||||
}
|
||||
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}`);
|
||||
}
|
||||
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));
|
||||
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
|
||||
return events.map(event => indexer.getResultEvent(event));
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
getStateByCID: async (_: any, { cid }: { cid: string }) => {
|
||||
getStateByCID: async (
|
||||
_: any,
|
||||
{ cid }: { cid: string },
|
||||
expressContext: ExpressContext
|
||||
) => {
|
||||
log('getStateByCID', cid);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('getStateByCID').inc(1);
|
||||
|
||||
const state = await indexer.getStateByCID(cid);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'getStateByCID',
|
||||
expressContext,
|
||||
async () => {
|
||||
const state = await indexer.getStateByCID(cid);
|
||||
|
||||
return state && state.block.isComplete ? getResultState(state) : undefined;
|
||||
return state && state.block.isComplete ? getResultState(state) : undefined;
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
getState: async (_: any, { blockHash, contractAddress, kind }: { blockHash: string, contractAddress: string, kind: string }) => {
|
||||
getState: async (
|
||||
_: any,
|
||||
{ blockHash, contractAddress, kind }: { blockHash: string, contractAddress: string, kind: string },
|
||||
expressContext: ExpressContext
|
||||
) => {
|
||||
log('getState', blockHash, contractAddress, kind);
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('getState').inc(1);
|
||||
|
||||
const state = await indexer.getPrevState(blockHash, contractAddress, kind);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'getState',
|
||||
expressContext,
|
||||
async () => {
|
||||
const state = await indexer.getPrevState(blockHash, contractAddress, kind);
|
||||
|
||||
return state && state.block.isComplete ? getResultState(state) : undefined;
|
||||
return state && state.block.isComplete ? getResultState(state) : undefined;
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
_meta: async (
|
||||
_: any,
|
||||
{ block = {} }: { block: BlockHeight }
|
||||
{ block = {} }: { block: BlockHeight },
|
||||
expressContext: ExpressContext
|
||||
) => {
|
||||
log('_meta');
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('_meta').inc(1);
|
||||
|
||||
return indexer.getMetaData(block);
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'_meta',
|
||||
expressContext,
|
||||
async () => indexer.getMetaData(block)
|
||||
);
|
||||
},
|
||||
|
||||
getSyncStatus: async () => {
|
||||
getSyncStatus: async (
|
||||
_: any,
|
||||
__: Record<string, never>,
|
||||
expressContext: ExpressContext
|
||||
) => {
|
||||
log('getSyncStatus');
|
||||
gqlTotalQueryCount.inc(1);
|
||||
gqlQueryCount.labels('getSyncStatus').inc(1);
|
||||
|
||||
return indexer.getSyncStatus();
|
||||
return executeAndRecordMetrics(
|
||||
indexer,
|
||||
gqlLogger,
|
||||
'getSyncStatus',
|
||||
expressContext,
|
||||
async () => indexer.getSyncStatus()
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -39,13 +39,7 @@ type ResultEvent {
|
||||
proof: Proof
|
||||
}
|
||||
|
||||
union Event = TestEvent | EmergencyTerminationExecutedEvent | LendingMarketInitializedEvent | MinDebtUnitPriceUpdatedEvent | OrderBookCreatedEvent | OrderBooksRotatedEvent | ZCTokenCreatedEvent | CacheUpdatedEvent | CurrencyRegisteredEvent | CurrencyUpdatedEvent | DepositEvent | FullLiquidationThresholdRateUpdatedEvent | InitializedEvent | LiquidationProtocolFeeRateUpdatedEvent | LiquidationThresholdRateUpdatedEvent | LiquidatorFeeRateUpdatedEvent | OwnershipTransferredEvent | PausedEvent | RoleAdminChangedEvent | RoleGrantedEvent | RoleRevokedEvent | TransferEvent | UnpausedEvent | WithdrawEvent | EmergencySettlementExecutedEvent | OrderFilledEvent | OrderPartiallyFilledEvent | OrdersFilledInAsyncEvent | RedemptionExecutedEvent | RepaymentExecutedEvent | ForcedRepaymentExecutedEvent | LiquidationExecutedEvent | BlockUnitPriceHistoryUpdatedEvent | OrderCanceledEvent | OrderExecutedEvent | OrdersCleanedEvent | PositionUnwoundEvent | PreOrderExecutedEvent | CircuitBreakerLimitRangeUpdatedEvent | ItayoseExecutedEvent | OrderFeeRateUpdatedEvent
|
||||
|
||||
type TestEvent {
|
||||
param1: String!
|
||||
param2: Int!
|
||||
param3: BigInt!
|
||||
}
|
||||
union Event = EmergencyTerminationExecutedEvent | LendingMarketInitializedEvent | MinDebtUnitPriceUpdatedEvent | OrderBookCreatedEvent | OrderBooksRotatedEvent | ZCTokenCreatedEvent | CacheUpdatedEvent | CurrencyRegisteredEvent | CurrencyUpdatedEvent | DepositEvent | FullLiquidationThresholdRateUpdatedEvent | InitializedEvent | LiquidationProtocolFeeRateUpdatedEvent | LiquidationThresholdRateUpdatedEvent | LiquidatorFeeRateUpdatedEvent | OwnershipTransferredEvent | PausedEvent | RoleAdminChangedEvent | RoleGrantedEvent | RoleRevokedEvent | TransferEvent | UnpausedEvent | WithdrawEvent | EmergencySettlementExecutedEvent | OrderFilledEvent | OrderPartiallyFilledEvent | OrdersFilledInAsyncEvent | RedemptionExecutedEvent | RepaymentExecutedEvent | ForcedRepaymentExecutedEvent | LiquidationExecutedEvent | BlockUnitPriceHistoryUpdatedEvent | OrderCanceledEvent | OrderExecutedEvent | OrdersCleanedEvent | PositionUnwoundEvent | PreOrderExecutedEvent | CircuitBreakerLimitRangeUpdatedEvent | ItayoseExecutedEvent | OrderFeeRateUpdatedEvent
|
||||
|
||||
type EmergencyTerminationExecutedEvent {
|
||||
timestamp: BigInt!
|
||||
|
@ -8,8 +8,8 @@ dataSources:
|
||||
network: filecoin-testnet
|
||||
source:
|
||||
abi: LendingMarketController
|
||||
address: "0xbbF4eb28204d4c289a8C9bE82bff334Dd66e1cBC"
|
||||
startBlock: 1493594
|
||||
address: "0x015528f1c2D7676bFf39d50a6c5a2686E68e3376"
|
||||
startBlock: 1576704
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.7
|
||||
@ -33,8 +33,8 @@ dataSources:
|
||||
network: filecoin-testnet
|
||||
source:
|
||||
abi: TokenVault
|
||||
address: "0x965920E2c6aa84b87dFDa8ac8495267edC3BC82C"
|
||||
startBlock: 1493598
|
||||
address: "0xc02Cf07B04B6AA45716BdC3D23656Ac55f70bdf5"
|
||||
startBlock: 1576708
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.7
|
||||
@ -55,8 +55,8 @@ dataSources:
|
||||
network: filecoin-testnet
|
||||
source:
|
||||
abi: LendingMarketController
|
||||
address: "0xbbF4eb28204d4c289a8C9bE82bff334Dd66e1cBC"
|
||||
startBlock: 1493594
|
||||
address: "0x015528f1c2D7676bFf39d50a6c5a2686E68e3376"
|
||||
startBlock: 1576704
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.7
|
||||
@ -77,8 +77,8 @@ dataSources:
|
||||
network: filecoin-testnet
|
||||
source:
|
||||
abi: LendingMarketController
|
||||
address: "0xbbF4eb28204d4c289a8C9bE82bff334Dd66e1cBC"
|
||||
startBlock: 1493594
|
||||
address: "0x015528f1c2D7676bFf39d50a6c5a2686E68e3376"
|
||||
startBlock: 1576704
|
||||
mapping:
|
||||
kind: ethereum/events
|
||||
apiVersion: 0.0.7
|
||||
|
441
yarn.lock
441
yarn.lock
@ -162,6 +162,29 @@
|
||||
dependencies:
|
||||
xss "^1.0.8"
|
||||
|
||||
"@babel/code-frame@^7.22.13":
|
||||
version "7.24.7"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465"
|
||||
integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==
|
||||
dependencies:
|
||||
"@babel/highlight" "^7.24.7"
|
||||
picocolors "^1.0.0"
|
||||
|
||||
"@babel/helper-validator-identifier@^7.24.7":
|
||||
version "7.24.7"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db"
|
||||
integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==
|
||||
|
||||
"@babel/highlight@^7.24.7":
|
||||
version "7.24.7"
|
||||
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d"
|
||||
integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==
|
||||
dependencies:
|
||||
"@babel/helper-validator-identifier" "^7.24.7"
|
||||
chalk "^2.4.2"
|
||||
js-tokens "^4.0.0"
|
||||
picocolors "^1.0.0"
|
||||
|
||||
"@cerc-io/assemblyscript@0.19.10-watcher-ts-0.1.2":
|
||||
version "0.19.10-watcher-ts-0.1.2"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fassemblyscript/-/0.19.10-watcher-ts-0.1.2/assemblyscript-0.19.10-watcher-ts-0.1.2.tgz#c6a20eeddca44ddb08994831845c0b172433566b"
|
||||
@ -171,10 +194,10 @@
|
||||
binaryen "101.0.0-nightly.20210723"
|
||||
long "^4.0.0"
|
||||
|
||||
"@cerc-io/cache@^0.2.90":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.90/cache-0.2.90.tgz#95791f16443cc3c48658df8cdf24941c85a5c456"
|
||||
integrity sha512-vezwldh6P97bKCDe820EbjVmweL1azsuWxZJM8KdmvTdjQNN56PP3JctvCt8agW5rrzfHIo64UBPptT9wheH0A==
|
||||
"@cerc-io/cache@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.98/cache-0.2.98.tgz#acbd54b0e3b0379652020f3dac832ed04cf392dc"
|
||||
integrity sha512-scrDlufZIs0DDehEUL+eaab4Rz2r4G2fgvy2USeY3AnItreXMgUwTUAR7pXqh3FOCuj9crNfysH09Et+49/F/w==
|
||||
dependencies:
|
||||
canonical-json "^0.0.4"
|
||||
debug "^4.3.1"
|
||||
@ -182,19 +205,19 @@
|
||||
fs-extra "^10.0.0"
|
||||
level "^7.0.0"
|
||||
|
||||
"@cerc-io/cli@^0.2.90":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.90/cli-0.2.90.tgz#16de193b744f683479cfd5fd293f495ca7433bd2"
|
||||
integrity sha512-DK4HK7+gGiwkzu/Iphe7E4MeVFABAflkAbMU+h8qHrp5T5rVh8rbLCsEF1sY64MZ2jwtUyq8jOYN0X5399uBmg==
|
||||
"@cerc-io/cli@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.98/cli-0.2.98.tgz#b29046fe48260e3e465c240d0aa64da84ad2338d"
|
||||
integrity sha512-d79Gm3YOLn+CEidPBHaQhm1zu873O75LnFyH7fbIOubC4cBDWQk+RdH5U+8jU4b54EPZeVRotSoo7rQ5V8HsDg==
|
||||
dependencies:
|
||||
"@apollo/client" "^3.7.1"
|
||||
"@cerc-io/cache" "^0.2.90"
|
||||
"@cerc-io/ipld-eth-client" "^0.2.90"
|
||||
"@cerc-io/cache" "^0.2.98"
|
||||
"@cerc-io/ipld-eth-client" "^0.2.98"
|
||||
"@cerc-io/libp2p" "^0.42.2-laconic-0.1.4"
|
||||
"@cerc-io/nitro-node" "^0.1.15"
|
||||
"@cerc-io/peer" "^0.2.90"
|
||||
"@cerc-io/rpc-eth-client" "^0.2.90"
|
||||
"@cerc-io/util" "^0.2.90"
|
||||
"@cerc-io/peer" "^0.2.98"
|
||||
"@cerc-io/rpc-eth-client" "^0.2.98"
|
||||
"@cerc-io/util" "^0.2.98"
|
||||
"@ethersproject/providers" "^5.4.4"
|
||||
"@graphql-tools/utils" "^9.1.1"
|
||||
"@ipld/dag-cbor" "^8.0.0"
|
||||
@ -215,16 +238,16 @@
|
||||
typeorm "0.2.37"
|
||||
yargs "^17.0.1"
|
||||
|
||||
"@cerc-io/graph-node@^0.2.90":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fgraph-node/-/0.2.90/graph-node-0.2.90.tgz#4e5451a0f384801524d9c78f65be9705a820cca9"
|
||||
integrity sha512-tMfPQBup+swhUjW+3S5/Kihy6dQ25VLynCwAo5ylE0vV1pm6U8suu8i2lcIu/Nu6Zkm/WzQ7FYl57phI4YdGuw==
|
||||
"@cerc-io/graph-node@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fgraph-node/-/0.2.98/graph-node-0.2.98.tgz#06b7eb0feb1e1c4ae4e203b6007b8f0c0ac3c218"
|
||||
integrity sha512-6PGVnPyRihW1f+yyU2TL61ALnsVN1f5MffmHxiJ+Co02F5t/RP7sfYjJPdT63S+W6mlwpnnmGyX0LuklOXpezQ==
|
||||
dependencies:
|
||||
"@apollo/client" "^3.3.19"
|
||||
"@cerc-io/assemblyscript" "0.19.10-watcher-ts-0.1.2"
|
||||
"@cerc-io/cache" "^0.2.90"
|
||||
"@cerc-io/ipld-eth-client" "^0.2.90"
|
||||
"@cerc-io/util" "^0.2.90"
|
||||
"@cerc-io/cache" "^0.2.98"
|
||||
"@cerc-io/ipld-eth-client" "^0.2.98"
|
||||
"@cerc-io/util" "^0.2.98"
|
||||
"@types/json-diff" "^0.5.2"
|
||||
"@types/yargs" "^17.0.0"
|
||||
bn.js "^4.11.9"
|
||||
@ -241,14 +264,14 @@
|
||||
typeorm-naming-strategies "^2.0.0"
|
||||
yargs "^17.0.1"
|
||||
|
||||
"@cerc-io/ipld-eth-client@^0.2.90":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.90/ipld-eth-client-0.2.90.tgz#2dd907177d0f1bda45af1631f20a3c39f934c243"
|
||||
integrity sha512-lQkDdawmMQhA9uYxrzvwURwuHr2hcbwaTArYy+p1Xyo/8DicJyxpwg+iHvDceKg971Iq/mDYjQa+HFvbTb+pxg==
|
||||
"@cerc-io/ipld-eth-client@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.98/ipld-eth-client-0.2.98.tgz#c1a7128be1e81fb4d1ec9a9888b7e5e94ae710ac"
|
||||
integrity sha512-qCnz7foqf+9+X/zEGAu5HGXlvzNwahcsKu6Rtreh8bxhR5VTuuF3KrEeFcQeL1Bhv5+w7KXs5I+ivEgo4ZvHSA==
|
||||
dependencies:
|
||||
"@apollo/client" "^3.7.1"
|
||||
"@cerc-io/cache" "^0.2.90"
|
||||
"@cerc-io/util" "^0.2.90"
|
||||
"@cerc-io/cache" "^0.2.98"
|
||||
"@cerc-io/util" "^0.2.98"
|
||||
cross-fetch "^3.1.4"
|
||||
debug "^4.3.1"
|
||||
ethers "^5.4.4"
|
||||
@ -371,7 +394,7 @@
|
||||
lodash "^4.17.21"
|
||||
uint8arrays "^4.0.3"
|
||||
|
||||
"@cerc-io/peer@^0.2.65", "@cerc-io/peer@^0.2.90":
|
||||
"@cerc-io/peer@^0.2.65":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.90/peer-0.2.90.tgz#4507ab3d793b7c4e35af26f26470e2770aac6319"
|
||||
integrity sha512-jrmbjJBXwrSYOqNkXaaAh2J30gVKV+4vXnZAiPYbpl6Tlo72iJOwWAzJLXJej48NNCkJkdpXkuxcsQZtsW90mQ==
|
||||
@ -401,6 +424,36 @@
|
||||
unique-names-generator "^4.7.1"
|
||||
yargs "^17.0.1"
|
||||
|
||||
"@cerc-io/peer@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.98/peer-0.2.98.tgz#650c771be2a3767456f38c93cb86e6667f2867ec"
|
||||
integrity sha512-b8sCTzFxfTgrlscNutBzML0y4rzkZvzjCpHDEp3P4fMRHIK9SM5o8yYaPS9g1NwoedjbLKCnCDrmaIGpLEbmqA==
|
||||
dependencies:
|
||||
"@cerc-io/libp2p" "^0.42.2-laconic-0.1.4"
|
||||
"@cerc-io/prometheus-metrics" "1.1.4"
|
||||
"@chainsafe/libp2p-gossipsub" "^6.0.0"
|
||||
"@chainsafe/libp2p-noise" "^11.0.0"
|
||||
"@chainsafe/libp2p-yamux" "3.0.7"
|
||||
"@libp2p/floodsub" "^6.0.0"
|
||||
"@libp2p/mplex" "^7.1.1"
|
||||
"@libp2p/peer-id-factory" "^2.0.0"
|
||||
"@libp2p/pubsub-peer-discovery" "^8.0.0"
|
||||
"@libp2p/websockets" "^5.0.5"
|
||||
"@multiformats/multiaddr" "^11.1.4"
|
||||
assert "^2.0.0"
|
||||
buffer "^6.0.3"
|
||||
chai "^4.3.4"
|
||||
debug "^4.3.1"
|
||||
it-length-prefixed "^8.0.4"
|
||||
it-map "^2.0.0"
|
||||
it-pipe "^2.0.5"
|
||||
it-pushable "^3.1.2"
|
||||
mocha "^8.4.0"
|
||||
p-event "^5.0.1"
|
||||
uint8arrays "^4.0.3"
|
||||
unique-names-generator "^4.7.1"
|
||||
yargs "^17.0.1"
|
||||
|
||||
"@cerc-io/prometheus-metrics@1.1.4":
|
||||
version "1.1.4"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fprometheus-metrics/-/1.1.4/prometheus-metrics-1.1.4.tgz#51006b0b5bf6168394390c78072a1c0bb2b02f28"
|
||||
@ -413,23 +466,23 @@
|
||||
it-stream-types "^1.0.4"
|
||||
promjs "^0.4.2"
|
||||
|
||||
"@cerc-io/rpc-eth-client@^0.2.90":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Frpc-eth-client/-/0.2.90/rpc-eth-client-0.2.90.tgz#e1c814571822cc790163df9f533ea562ed5f1d23"
|
||||
integrity sha512-+MJ2kNGnZnJvS2KPHGy2iu8UFj6tNHz1Clz3ZbICXiQHGQv9ROs0yvugt/HgFXFin3zIjpPyPJcdQ0VkskJlsA==
|
||||
"@cerc-io/rpc-eth-client@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Frpc-eth-client/-/0.2.98/rpc-eth-client-0.2.98.tgz#005546cf25a245e60fa00b0c972239748ac1c29e"
|
||||
integrity sha512-SjR621w5WxrhLsXyy17mTXo1UwvcPz9QPL4/mwQcwsvzDXoFff1bgxR7UGKInQG5QzGgwTJjAaozVqxQA1X3+g==
|
||||
dependencies:
|
||||
"@cerc-io/cache" "^0.2.90"
|
||||
"@cerc-io/ipld-eth-client" "^0.2.90"
|
||||
"@cerc-io/util" "^0.2.90"
|
||||
"@cerc-io/cache" "^0.2.98"
|
||||
"@cerc-io/ipld-eth-client" "^0.2.98"
|
||||
"@cerc-io/util" "^0.2.98"
|
||||
chai "^4.3.4"
|
||||
ethers "^5.4.4"
|
||||
left-pad "^1.3.0"
|
||||
mocha "^8.4.0"
|
||||
|
||||
"@cerc-io/solidity-mapper@^0.2.90":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.90/solidity-mapper-0.2.90.tgz#6b0da45b2030ed818d25a1212cf7485b80142fa4"
|
||||
integrity sha512-0Ydbjb/WwRmbEYzBDzIBM4I58YpRl2tsdjp4mrdI68rBVonzFOFxNryrCutqkB2mWOUkayznKiUmPESZA3Yj9A==
|
||||
"@cerc-io/solidity-mapper@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.98/solidity-mapper-0.2.98.tgz#6fc8dfcaf872e31964a6cca1ea9fbd7900119f8a"
|
||||
integrity sha512-RmGmcgN0fZEZU0r4q14qPm2hVHUK/OQVPIEgyLEbcStHXupYLaTn79li1WpURI7yeVuJ7mFVaauviWA2DeG7dw==
|
||||
dependencies:
|
||||
dotenv "^10.0.0"
|
||||
|
||||
@ -438,15 +491,15 @@
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fts-channel/-/1.0.3-ts-nitro-0.1.1/ts-channel-1.0.3-ts-nitro-0.1.1.tgz#0768781313a167295c0bf21307f47e02dc17e936"
|
||||
integrity sha512-2jFICUSyffuZ+8+qRhXuLSJq4GJ6Y02wxiXoubH0Kzv2lIKkJtWICY1ZQQhtXAvP0ncAQB85WJHqtqwH8l7J3Q==
|
||||
|
||||
"@cerc-io/util@^0.2.90":
|
||||
version "0.2.90"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.90/util-0.2.90.tgz#bd220c2ccf4cb118c078651078d59f3af92bd85c"
|
||||
integrity sha512-LrbeZA0vLCxJTEj3bFQaCANwhF3VnBhmVipg34aw4An0pryqNc6OWOoz+aMK16wahrGLoMfNfd2iOUfmXalpAA==
|
||||
"@cerc-io/util@^0.2.98":
|
||||
version "0.2.98"
|
||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.98/util-0.2.98.tgz#0bed961a20d43c8973d5b86b400086caa76d2d0a"
|
||||
integrity sha512-s1St/bD9OjD3NIfx3gj1tDELgpiyxGl6le3mCs77jHM4KbEHW7pFjhe/5YsLXRvc5cIHwNsrCdOuSAIyVUtC2Q==
|
||||
dependencies:
|
||||
"@apollo/utils.keyvaluecache" "^1.0.1"
|
||||
"@cerc-io/nitro-node" "^0.1.15"
|
||||
"@cerc-io/peer" "^0.2.90"
|
||||
"@cerc-io/solidity-mapper" "^0.2.90"
|
||||
"@cerc-io/peer" "^0.2.98"
|
||||
"@cerc-io/solidity-mapper" "^0.2.98"
|
||||
"@cerc-io/ts-channel" "1.0.3-ts-nitro-0.1.1"
|
||||
"@ethersproject/properties" "^5.7.0"
|
||||
"@ethersproject/providers" "^5.4.4"
|
||||
@ -484,9 +537,11 @@
|
||||
pg "^8.5.1"
|
||||
pg-boss "^6.1.0"
|
||||
prom-client "^14.0.1"
|
||||
read-pkg "^9.0.1"
|
||||
toml "^3.0.0"
|
||||
typeorm "0.2.37"
|
||||
typeorm-naming-strategies "^2.0.0"
|
||||
winston "^3.13.0"
|
||||
ws "^8.11.0"
|
||||
yargs "^17.0.1"
|
||||
|
||||