import { Connector } from '../../connectors/Connector' ; import { Cid , Message , MpoolConfig , MpoolUpdate , SignedMessage , TipSetKey } from '../Types' ; import { WsJsonRpcConnector } from '../../index' ; /**
 * The Mpool methods are for interacting with the message pool. The message pool manages all incoming and outgoing 'messages' going over the network.
 */ export class JsonRpcMPoolMethodGroup { private conn : Connector ; constructor ( conn ) { this . conn = conn ; } /**
     * returns (a copy of) the current mpool config
     */ public async getMpoolConfig ( ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolGetConfig' , params : [ ] } ) ; return ret ; } param config public async setMpoolConfig ( config ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolSetConfig' , params : [ config ] } ) ; return ret ; } /**
     * clears pending messages from the mpool
     */ public async clear ( ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolClear' , params : [ true ] } ) ; return ret ; } param tipSetKey public async getMpoolPending ( tipSetKey ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolPending' , params : [ tipSetKey ] } ) ; return ret ; } param tipSetKey param ticketQuality public async select ( tipSetKey , ticketQuality ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolSelect' , params : [ tipSetKey , ticketQuality ] } ) ; return ret ; } param tipSetKey param ticketQuality public async sub ( cb ) { if ( this . conn instanceof WsJsonRpcConnector ) { const subscriptionId = await this . conn . request ( { method : 'Filecoin.MpoolSub' , } ) ; this . conn . on ( subscriptionId , cb ) ; } } param address public async getNonce ( address ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolGetNonce' , params : [ address ] } ) ; return ret as number ; } remarks param msg public async pushMessage ( msg ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolPushMessage' , params : [ msg , { MaxFee : "30000000000000" } ] } ) ; return ret as SignedMessage ; } param msg public async push ( msg ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolPush' , params : [ msg ] } ) ; return ret as Cid ; } param message public async pushUntrusted ( message ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolPushUntrusted' , params : [ message ] } ) ; return ret ; } param messages public async batchPush ( messages ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolBatchPush' , params : [ messages ] } ) ; return ret ; } param messages public async batchPushUntrusted ( messages ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolBatchPushUntrusted' , params : [ messages ] } ) ; return ret ; } param messages public async batchPushMessage ( messages ) { const ret = await this . conn . request ( { method : 'Filecoin.MpoolBatchPushMessage' , params : [ messages ] } ) ; return ret ; } }