diff --git a/api/api_gateway.go b/api/api_gateway.go index 187fad86f..08b3e0681 100644 --- a/api/api_gateway.go +++ b/api/api_gateway.go @@ -43,4 +43,5 @@ type Gateway interface { StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error) StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch, allowReplaced bool) (*MsgLookup, error) + WalletBalance(context.Context, address.Address) (types.BigInt, error) } diff --git a/api/proxy_gen.go b/api/proxy_gen.go index 402da34c0..bfaaade94 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -516,6 +516,8 @@ type GatewayStruct struct { StateVerifiedClientStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `` StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch, p4 bool) (*MsgLookup, error) `` + + WalletBalance func(p0 context.Context, p1 address.Address) (types.BigInt, error) `` } } @@ -2601,6 +2603,14 @@ func (s *GatewayStub) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64, p3 return nil, xerrors.New("method not supported") } +func (s *GatewayStruct) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) { + return s.Internal.WalletBalance(p0, p1) +} + +func (s *GatewayStub) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) { + return *new(types.BigInt), xerrors.New("method not supported") +} + func (s *SignableStruct) Sign(p0 context.Context, p1 SignFunc) error { return s.Internal.Sign(p0, p1) } diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz index 0e258fe64..83e319db5 100644 Binary files a/build/openrpc/full.json.gz and b/build/openrpc/full.json.gz differ diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz index 00fbcf797..3797357ba 100644 Binary files a/build/openrpc/miner.json.gz and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz index eaae7109d..33b8c5ebe 100644 Binary files a/build/openrpc/worker.json.gz and b/build/openrpc/worker.json.gz differ diff --git a/cmd/lotus-gateway/api.go b/cmd/lotus-gateway/api.go index b1ddd369e..003625a84 100644 --- a/cmd/lotus-gateway/api.go +++ b/cmd/lotus-gateway/api.go @@ -71,6 +71,7 @@ type gatewayDepsAPI interface { StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (api.CirculatingSupply, error) + WalletBalance(context.Context, address.Address) (types.BigInt, error) //perm:read } var _ gatewayDepsAPI = *new(api.FullNode) // gateway depends on latest @@ -414,6 +415,10 @@ func (a *GatewayAPI) WalletVerify(ctx context.Context, k address.Address, msg [] return sigs.Verify(sig, k, msg) == nil, nil } +func (a *GatewayAPI) WalletBalance(ctx context.Context, k address.Address) (types.BigInt, error) { + return a.api.WalletBalance(ctx, k) +} + var _ api.Gateway = (*GatewayAPI)(nil) var _ full.ChainModuleAPI = (*GatewayAPI)(nil) var _ full.GasModuleAPI = (*GatewayAPI)(nil)