import { Address, Logger, SubgraphDeploymentID } from '@graphprotocol/common-ts'; import { Allocation, Provision } from '../allocations'; import { GraphNode } from '../graph-node'; import { SubgraphDeployment } from '../types'; import { TransactionReceipt } from 'ethers'; export interface CreateAllocationResult { actionID: number; type: 'allocate'; transactionID: string | undefined; allocation: string; deployment: string; allocatedTokens: string; protocolNetwork: string; } export interface CloseAllocationResult { actionID: number; type: 'unallocate'; transactionID: string | undefined; allocation: string; allocatedTokens: string; indexingRewards: string; protocolNetwork: string; } export interface ReallocateAllocationResult { actionID: number; type: 'reallocate'; transactionID: string | undefined; secondTransactionID?: string; closedAllocation: string; indexingRewardsCollected: string; createdAllocation: string; createdAllocationStake: string; protocolNetwork: string; } export interface ActionExecutionResult { actionID: number; success: boolean; result: AllocationResult; } export interface ExecuteActionResult { actionID: number; success: boolean; result: (ActionFailure | TransactionReceipt | 'paused' | 'unauthorized')[]; } export interface ActionFailure { actionID: number; transactionID?: string; failureReason: string; protocolNetwork: string; } export declare const isActionFailure: (variableToCheck: any) => variableToCheck is ActionFailure; export declare const isPartialActionFailure: (variableToCheck: any) => variableToCheck is Partial; export declare function isTransactionReceiptArray(arr: (ActionFailure | TransactionReceipt | 'paused' | 'unauthorized')[]): arr is TransactionReceipt[]; export declare const isActionFailureArray: (variableToCheck: any) => variableToCheck is ActionFailure[]; export type AllocationResult = CreateAllocationResult | CloseAllocationResult | ReallocateAllocationResult | ActionFailure; export declare const parseGraphQLSubgraphDeployment: (subgraphDeployment: any, protocolNetwork: string) => SubgraphDeployment; export declare const parseGraphQLAllocation: (allocation: any, protocolNetwork: string) => Allocation; export declare const parseGraphQLProvision: (provision: any) => Provision; export interface RewardsPool { subgraphDeployment: SubgraphDeploymentID; allocationIndexer: Address; allocationCreatedAtBlockHash: string; closedAtEpoch: number; closedAtEpochStartBlockHash: string | undefined; closedAtEpochStartBlockNumber: number | undefined; previousEpochStartBlockHash: string | undefined; previousEpochStartBlockNumber: number | undefined; referencePOI: string | undefined; referencePreviousPOI: string | undefined; } export declare const allocationRewardsPool: (allocation: Allocation) => RewardsPool; export interface Epoch { id: number; startBlock: number; startBlockHash: string | undefined; endBlock: number; signalledTokens: number; stakeDeposited: number; queryFeeRebates: number; totalRewards: number; totalIndexerRewards: number; totalDelegatorRewards: number; } export declare const parseGraphQLEpochs: (epoch: any) => Epoch; export interface NetworkEpoch { networkID: string; epochNumber: number; startBlockNumber: number; startBlockHash: string; latestBlock: number; } export declare function epochElapsedBlocks(networkEpoch: NetworkEpoch): number; /** * Unified async initialization needed for the common module. * This function should be called once when an application starts. * Needed to fetch & construct lookups for the networks registry. */ export declare function common_init(logger: Logger): Promise; export declare function resolveChainId(key: number | string): string; export declare function resolveChainAlias(id: string): string; export declare function validateProviderNetworkIdentifier(providerNetworkIdentifier: string, networkSubgraphDeploymentIpfsHash: string, graphNode: GraphNode, logger: Logger): Promise; export declare enum IndexingStatusCode { Unknown = 0, Healthy = 1, Unhealthy = 2, Failed = 3 } export interface POIData { poi: string; publicPOI: string; blockNumber: number; indexingStatus: IndexingStatusCode; }