import Transaction , { TxnJsonObject , StateChannelCloseV1 } from '../models/Transaction' ; import type Client from '../Client' ; import ResourceList from '../ResourceList' ; interface ListParams { cursor ? : string ; } export default class StateChannels { private client ! : Client ; constructor ( client ) { this . client = client ; } async list ( params = { } ) { const url = '/state_channels' ; const response = await this . client . get ( url , { cursor : params . cursor } ) ; const { data : { data : stateChannels , cursor } , } = response ; const data = stateChannels . map ( ( d ) => Transaction . fromJsonObject ( d ) ) ; return new ResourceList ( data , this . list . bind ( this ) , cursor ) ; } }