2020-09-29 15:25:45 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2020-10-23 14:51:27 +00:00
|
|
|
"github.com/ipfs/go-cid"
|
|
|
|
|
2020-09-29 15:25:45 +00:00
|
|
|
"github.com/filecoin-project/go-address"
|
2020-10-02 14:14:30 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
2020-10-23 14:51:27 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/dline"
|
2020-10-09 11:41:09 +00:00
|
|
|
"github.com/filecoin-project/go-state-types/network"
|
2020-10-23 14:51:27 +00:00
|
|
|
|
2020-10-09 11:41:09 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
2020-09-29 15:25:45 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
type GatewayAPI interface {
|
2020-10-15 10:15:21 +00:00
|
|
|
ChainHasObj(context.Context, cid.Cid) (bool, error)
|
2020-09-29 15:25:45 +00:00
|
|
|
ChainHead(ctx context.Context) (*types.TipSet, error)
|
2020-10-09 11:41:09 +00:00
|
|
|
ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error)
|
|
|
|
ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error)
|
2020-09-29 15:25:45 +00:00
|
|
|
ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error)
|
2020-10-02 14:14:30 +00:00
|
|
|
ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error)
|
2020-10-09 11:41:09 +00:00
|
|
|
ChainNotify(context.Context) (<-chan []*HeadChange, error)
|
2020-10-15 10:15:21 +00:00
|
|
|
ChainReadObj(context.Context, cid.Cid) ([]byte, error)
|
2020-10-05 15:09:21 +00:00
|
|
|
GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *MessageSendSpec, tsk types.TipSetKey) (*types.Message, error)
|
2020-09-29 15:25:45 +00:00
|
|
|
MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error)
|
2020-10-07 16:14:12 +00:00
|
|
|
MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error)
|
|
|
|
MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error)
|
2021-02-04 04:46:10 +00:00
|
|
|
MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error)
|
2020-09-29 15:25:45 +00:00
|
|
|
StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
|
2020-10-09 11:41:09 +00:00
|
|
|
StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (DealCollateralBounds, error)
|
2020-09-30 14:36:16 +00:00
|
|
|
StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error)
|
2020-10-09 11:41:09 +00:00
|
|
|
StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error)
|
|
|
|
StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error)
|
2020-09-30 14:36:16 +00:00
|
|
|
StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
|
2020-10-09 11:41:09 +00:00
|
|
|
StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (MarketBalance, error)
|
|
|
|
StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*MarketDeal, error)
|
|
|
|
StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error)
|
2020-10-23 14:51:27 +00:00
|
|
|
StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error)
|
|
|
|
StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error)
|
2020-10-09 11:41:09 +00:00
|
|
|
StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error)
|
2021-01-19 10:19:31 +00:00
|
|
|
StateSearchMsg(ctx context.Context, msg cid.Cid) (*MsgLookup, error)
|
2020-11-20 16:30:17 +00:00
|
|
|
StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error)
|
2020-10-20 15:08:25 +00:00
|
|
|
StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error)
|
2020-10-02 14:14:30 +00:00
|
|
|
StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*MsgLookup, error)
|
2020-09-29 15:25:45 +00:00
|
|
|
}
|