2019-11-08 17:15:38 +00:00
|
|
|
package market
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"go.uber.org/fx"
|
|
|
|
|
2019-12-19 20:13:17 +00:00
|
|
|
"github.com/filecoin-project/go-address"
|
2019-11-08 17:15:38 +00:00
|
|
|
"github.com/filecoin-project/lotus/chain/market"
|
|
|
|
"github.com/filecoin-project/lotus/chain/types"
|
2020-05-05 01:31:56 +00:00
|
|
|
"github.com/ipfs/go-cid"
|
2019-11-08 17:15:38 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MarketAPI struct {
|
|
|
|
fx.In
|
|
|
|
|
2020-11-10 15:45:48 +00:00
|
|
|
FMgr *market.FundManager
|
2019-11-08 17:15:38 +00:00
|
|
|
}
|
|
|
|
|
2020-11-10 15:45:48 +00:00
|
|
|
func (a *MarketAPI) MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) {
|
|
|
|
return a.FMgr.Reserve(ctx, wallet, addr, amt)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *MarketAPI) MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error {
|
|
|
|
return a.FMgr.Release(addr, amt)
|
2019-11-08 17:15:38 +00:00
|
|
|
}
|