diff --git a/service/popm/popm.go b/service/popm/popm.go index 896060ed7..d7c425716 100644 --- a/service/popm/popm.go +++ b/service/popm/popm.go @@ -368,6 +368,22 @@ func (m *Miner) Ping(ctx context.Context, timestamp int64) (*bfgapi.PingResponse return pr, nil } +func (m *Miner) L2Keystones(ctx context.Context, count uint64) (*bfgapi.L2KeystonesResponse, error) { + res, err := m.callBFG(ctx, m.requestTimeout, &bfgapi.L2KeystonesRequest{ + NumL2Keystones: count, + }) + if err != nil { + return nil, fmt.Errorf("l2keystones: %w", err) + } + + kr, ok := res.(*bfgapi.L2KeystonesResponse) + if !ok { + return nil, fmt.Errorf("not a L2KeystonesResponse: %T", res) + } + + return kr, nil +} + func (m *Miner) BitcoinBalance(ctx context.Context, scriptHash string) (*bfgapi.BitcoinBalanceResponse, error) { if scriptHash[0:2] == "0x" || scriptHash[0:2] == "0X" { scriptHash = scriptHash[2:]