/******************************************************************************* * (c) 2023 unipackage * * Licensed under either the MIT License (the "MIT License") or the Apache License, Version 2.0 * (the "Apache License"). You may not use this file except in compliance with one of these * licenses. You may obtain a copy of the MIT License at * * https://opensource.org/licenses/MIT * * Or the Apache License, Version 2.0 at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the MIT License or the Apache License for the specific language governing permissions and * limitations under the respective licenses. ********************************************************************************/ import { Result } from "@unipackage/utils"; import { Chain } from "../types"; import { BlockMongoDatastore, MessageMongoDatastore, TipsetMongoDatastore } from "../repo/datastore"; import { ChainFilecoinRPC } from "../repo/rpc"; import { ReplayStrategyOptions } from "../../shared/replayStrategy"; export interface ChainServiceOptions { rpc: ChainFilecoinRPC; messageDs: MessageMongoDatastore; blockMessagesDs: BlockMongoDatastore; tipsetDs: TipsetMongoDatastore; replayStrategyOptions?: ReplayStrategyOptions; } export interface ChainService { GetChainInfoByHeight(height: number, replayStrategyOptions?: ReplayStrategyOptions): Promise>; SaveChainInfo(chain: Chain): Promise>; GetAndSaveChainInfoByHeight(height: number, replayStrategyOptions?: ReplayStrategyOptions): Promise>; } /** * Implementation of the chain service providing methods to retrieve, save, and process chain information. */ export declare class ChainService implements ChainService { private rpc; private messageDs; private blockMessagesDs; private tipsetDs; private replayStrategyOptions; constructor(options: ChainServiceOptions); } //# sourceMappingURL=index.d.ts.map