import { EthApi } from "@joincivil/ethapi"; import { BigNumber } from "@joincivil/typescript-types"; import { Observable } from "rxjs"; import { EthAddress, TwoStepEthTransaction } from "../../types"; import { BaseWrapper } from "../basewrapper"; import { MultiSigWalletContract } from "../generated/wrappers/multi_sig_wallet"; import { MultisigTransaction } from "./multisigtransaction"; import { TransactionConfig } from "web3-core"; export declare class Multisig extends BaseWrapper { static atUntrusted(ethApi: EthApi, address: EthAddress): Multisig; static deployTrusted(ethApi: EthApi, owners: EthAddress[], required: number): Promise>; private constructor(); /** * A list of current owners that can submit, confirm and execute transactions * in this wallet */ owners(): Promise; /** * Returns whether the provided address is one of the owners of the Wallet * @param address If null, checks your account, othwerise checks the provided address */ isOwner(address?: EthAddress): Promise; /** * How many owners need to confirm a submited transaction before it's allowed to be executed */ required(): Promise; /** * Adds an additional owner to the Wallet * This transaction can be only done by the wallet itself - this means it's multistep. * First a current owner submits a new transaction to the wallet, not actually adding owner. * When that transaction is executed by the required number of owners, then the new owner is added * @param owner New owner in the Wallet */ addOwner(owner: EthAddress): Promise>; estimateAddOwner(owner: EthAddress): Promise; /** * Removes an owner from the Wallet * This transaction can be only done by the wallet itself - this means it's multistep. * First a current owner submits a new transaction to the wallet, not actually removing owner. * When that transaciton is executed by the required number of owners, then the owner is removed. * * Additionally, there can't be less owners then the number of required confirmations of the transaction * * @param owner New owner in the Wallet */ removeOwner(owner: EthAddress): Promise>; /** * Swaps some existing owner in the Wallet for a new address * This transaction can be only done by the wallet itself - this means it's multistep. * First a current owner submits a new transaction to the wallet, not actually swapping. * When that transaction is executed by the required number of owners, then the owners are swapped. * * This can be used to minimize the amount of transactions, or to ensure proper balacne of power during exchange * * @param owner New owner in the Wallet */ replaceOwner(oldOwner: EthAddress, newOwner: EthAddress): Promise>; /** * Sends money from the current active account to the multisig wallet * @param ethers How many ethers to send */ transferEther(ether: BigNumber): Promise; /** * Changes how many confirmations the transaction needs to have before it can be executed * This transaction can be only done by the wallet itself - this means it's multistep. * First a current owner submits a new transaction to the wallet, not actually changing. * When that transaction is executed by the required number of owners, then the requirement is changed. * * Additionally, the required number of confirmations can't be higher than number of owners * * @param newRequired New required number of confirmations */ changeRequirement(newRequired: number): Promise>; /** * Low-level call * Requests that a transaction is sent from this Multisignature wallet. * If the amount of required owners is 1, it is executed immediately. * Otherwise it's put in the list of awaiting transactions. * The required number of owners need to confirm that they approve this transaction. * With the last transaction, it is sent out to the world. * @param address Who is the receipent of this transaction * @param weiToSend How much value to you want to send through this transaction * @param payload What bytes do you want to send along as the payload */ submitTransaction(address: EthAddress, weiToSend: BigNumber, payload: string): Promise>; confirmTransaction(txId: number): Promise>; estimateTransaction(address: EthAddress, weiToSend: BigNumber, payload: string): Promise; getRawTransaction(address: EthAddress, weiToSend: BigNumber, payload: string): Promise; /** * Counts how many transactions, with those specific criteria set by filters are in this multisig * @param filters Change which transactions are counted. */ transactionCount(filters?: TransactionFilters): Promise; /** * Returns a finite stream of transactions according to the filters. * This call takes quite a long time due to network communication, and thus * is a RXJS stream. The transactions will show up in the subscription as they come, in the increasing * order of ids, starting from id 0. * @param filters What kind of transactions to return */ transactions(filters?: TransactionFilters): Observable; /** * Returns a singular transaction * @param id Id the of the wanted transaction */ transaction(id: number): Promise; private requireOwner; } export interface TransactionFilters { pending?: boolean; executed?: boolean; }