import { Connector } from '../../connectors/Connector' ; import { Address , ChannelAvailableFunds , ChannelInfo , Cid , PaychStatus , PaymentInfo , SignedVoucher , VoucherCreateResult , VoucherSpec , } from '../Types' ; /**
 * The Paych methods are for interacting with and managing payment channels
 */ export class JsonRpcPaychMethodGroup { private conn : Connector ; constructor ( conn ) { this . conn = conn ; } param from param to param amount public async getPaymentChannel ( from , to , amount ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychGet' , params : [ from , to , amount ] } ) ; return ret ; } param cid public async getWaitReadyPaymentChannel ( cid ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychGetWaitReady' , params : [ cid ] } ) ; return ret ; } /**
     * PaychList
     */ public async getList ( ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychList' , params : [ ] } ) ; return ret ; } param address public async status ( address ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychStatus' , params : [ address ] } ) ; return ret ; } param address public async allocateLane ( address ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychAllocateLane' , params : [ address ] } ) ; return ret ; } param address public async settle ( address ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychSettle' , params : [ address ] } ) ; return ret ; } param address public async collect ( address ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychCollect' , params : [ address ] } ) ; return ret ; } param address public async getAvailableFunds ( address ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychAvailableFunds' , params : [ address ] } ) ; return ret ; } param from param to public async getAvailableFundsByFromTo ( from , to ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychAvailableFundsByFromTo' , params : [ from , to ] } ) ; return ret ; } param from param to param vouchers public async newPayment ( from , to , vouchers ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychNewPayment' , params : [ from , to , vouchers ] } ) ; return ret ; } param address param amount param lane public async voucherCreate ( address , amount , lane ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychVoucherCreate' , params : [ address , amount , lane ] } ) ; return ret ; } param address public async voucherList ( address ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychVoucherList' , params : [ address ] } ) ; return ret ; } param address param signedVoucher public async voucherCheckValid ( address , signedVoucher ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychVoucherCheckValid' , params : [ address , signedVoucher ] } ) ; return ret ; } param address param signedVoucher param proof param minDelta public async voucherAdd ( address , signedVoucher , proof , minDelta ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychVoucherAdd' , params : [ address , signedVoucher , proof , minDelta ] } ) ; return ret ; } param address param signedVoucher param secret param proof public async voucherCheckSpendable ( address , signedVoucher , secret , proof ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychVoucherCheckSpendable' , params : [ address , signedVoucher , secret , proof ] } ) ; return ret ; } param address param signedVoucher param secret param proof public async voucherSubmit ( address , signedVoucher , secret , proof ) { const ret = await this . conn . request ( { method : 'Filecoin.PaychVoucherSubmit' , params : [ address , signedVoucher , secret , proof ] } ) ; return ret ; } }