import { Connector } from '../../connectors/Connector' ; import { Address , ChainEpoch , Cid , MsigVesting , TipSetKey } from '../Types' ; /**
 * The Msig methods are used to interact with multisig wallets on the filecoin network
 */ export class JsonRpcMsigMethodGroup { private conn : Connector ; constructor ( conn ) { this . conn = conn ; } param address param tipSetKey public async getAvailableBalance ( address , tipSetKey ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigGetAvailableBalance' , params : [ address , tipSetKey ] } ) ; return ret ; } param address param startEpoch param endEpoch public async getVested ( address , startEpoch , endEpoch ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigGetVested' , params : [ address , startEpoch , endEpoch ] } ) ; return ret ; } param requiredNumberOfSenders param approvingAddresses param unlockDuration param initialBalance param senderAddressOfCreateMsg param gasPrice public async create ( requiredNumberOfSenders , approvingAddresses , unlockDuration , initialBalance , senderAddressOfCreateMsg , gasPrice ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigCreate' , params : [ requiredNumberOfSenders , approvingAddresses , unlockDuration , initialBalance , senderAddressOfCreateMsg , gasPrice ] } ) ; return ret ; } param address param recipientAddres param value param senderAddressOfProposeMsg param methodToCallInProposeMsg param paramsToIncludeInProposeMsg public async propose ( address , recipientAddres , value , senderAddressOfProposeMsg , methodToCallInProposeMsg , paramsToIncludeInProposeMsg ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigPropose' , params : [ address , recipientAddres , value , senderAddressOfProposeMsg , methodToCallInProposeMsg , paramsToIncludeInProposeMsg ] } ) ; return ret ; } param address param proposedTransactionId param signerAddress public async approve ( address , proposedTransactionId , signerAddress ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigApprove' , params : [ address , proposedTransactionId , signerAddress ] } ) ; return ret ; } param address param proposedMessageId param proposerAddress param recipientAddres param value param senderAddressOfApproveMsg param methodToCallInProposeMsg param paramsToIncludeInProposeMsg public async approveTxnHash ( address , proposedMessageId , proposerAddress , recipientAddres , value , senderAddressOfApproveMsg , methodToCallInProposeMsg , paramsToIncludeInProposeMsg ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigApproveTxnHash' , params : [ address , proposedMessageId , proposerAddress , recipientAddres , value , senderAddressOfApproveMsg , methodToCallInProposeMsg , paramsToIncludeInProposeMsg ] } ) ; return ret ; } param address param proposedMessageId param proposerAddress param recipientAddres param value param senderAddressOfCancelMsg param methodToCallInProposeMsg param paramsToIncludeInProposeMsg public async cancel ( address , proposedMessageId , proposerAddress , recipientAddres , value , senderAddressOfCancelMsg , methodToCallInProposeMsg , paramsToIncludeInProposeMsg ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigCancel' , params : [ address , proposedMessageId , proposerAddress , recipientAddres , value , senderAddressOfCancelMsg , methodToCallInProposeMsg , paramsToIncludeInProposeMsg ] } ) ; return ret ; } param address param senderAddressOfProposeMsg param newSignerAddress param increaseNumberOfRequiredSigners public async addPropose ( address , senderAddressOfProposeMsg , newSignerAddress , increaseNumberOfRequiredSigners ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigAddPropose' , params : [ address , senderAddressOfProposeMsg , newSignerAddress , increaseNumberOfRequiredSigners ] } ) ; return ret ; } param address param senderAddressOfApproveMsg param proposedMessageId param proposerAddress param newSignerAddress param increaseNumberOfRequiredSigners public async addApprove ( address , senderAddressOfApproveMsg , proposedMessageId , proposerAddress , newSignerAddress , increaseNumberOfRequiredSigners ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigAddApprove' , params : [ address , senderAddressOfApproveMsg , proposedMessageId , proposerAddress , newSignerAddress , increaseNumberOfRequiredSigners ] } ) ; return ret ; } param address param senderAddressOfCancelMsg param proposedMessageId param newSignerAddress param increaseNumberOfRequiredSigners public async addCancel ( address , senderAddressOfCancelMsg , proposedMessageId , newSignerAddress , increaseNumberOfRequiredSigners ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigAddCancel' , params : [ address , senderAddressOfCancelMsg , proposedMessageId , newSignerAddress , increaseNumberOfRequiredSigners ] } ) ; return ret ; } param address param senderAddressOfProposeMsg param oldSignerAddress param newSignerAddress public async swapPropose ( address , senderAddressOfProposeMsg , oldSignerAddress , newSignerAddress ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigSwapPropose' , params : [ address , senderAddressOfProposeMsg , oldSignerAddress , newSignerAddress ] } ) ; return ret ; } param address param senderAddressOfApproveMsg param proposedMessageId param proposerAddress param oldSignerAddress param newSignerAddress public async swapApprove ( address , senderAddressOfApproveMsg , proposedMessageId , proposerAddress , oldSignerAddress , newSignerAddress ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigSwapApprove' , params : [ address , senderAddressOfApproveMsg , proposedMessageId , proposerAddress , oldSignerAddress , newSignerAddress , ] } ) ; return ret ; } param address param senderAddressOfCancelMsg param proposedMessageId param oldSignerAddress param newSignerAddress public async swapCancel ( address , senderAddressOfCancelMsg , proposedMessageId , oldSignerAddress , newSignerAddress ) { const ret = await this . conn . request ( { method : 'Filecoin.MsigSwapCancel' , params : [ address , senderAddressOfCancelMsg , proposedMessageId , oldSignerAddress , newSignerAddress , ] } ) ; return ret ; } param address param tipSetKey public async getVestingSchedule ( address , tipSetKey ) { const schedule = await this . conn . request ( { method : 'Filecoin.MsigGetVestingSchedule' , params : [ address , tipSetKey ] } ) ; return schedule ; } param msigAddress param proposerAddress param toRemoveAddress param decrease remarks public async removeSigner ( msigAddress , proposerAddress , toRemoveAddress , decrease ) { const cid = await this . conn . request ( { method : 'Filecoin.MsigRemoveSigner' , params : [ msigAddress , proposerAddress , toRemoveAddress , decrease ] } ) ; return cid ; } }