@celo/contractkit
Version:
Celo's ContractKit to interact with Celo network
51 lines (50 loc) • 2.24 kB
TypeScript
import { MultiSig } from '@celo/abis/web3/MultiSig';
import { Address, CeloTransactionObject, CeloTxObject } from '@celo/connect';
import BigNumber from 'bignumber.js';
import { BaseWrapper } from './BaseWrapper';
export interface TransactionData {
destination: string;
value: BigNumber;
data: string;
executed: boolean;
confirmations: string[];
}
export interface TransactionDataWithOutConfirmations {
destination: string;
value: BigNumber;
data: string;
executed: boolean;
}
/**
* Contract for handling multisig actions
*/
export declare class MultiSigWrapper extends BaseWrapper<MultiSig> {
/**
* Allows an owner to submit and confirm a transaction.
* If an unexecuted transaction matching `txObject` exists on the multisig, adds a confirmation to that tx ID.
* Otherwise, submits the `txObject` to the multisig and add confirmation.
* @param index The index of the pending withdrawal to withdraw.
*/
submitOrConfirmTransaction(destination: string, txObject: CeloTxObject<any>, value?: string): Promise<CeloTransactionObject<void> | CeloTransactionObject<string>>;
confirmTransaction(transactionId: number): Promise<CeloTransactionObject<void>>;
isOwner: (owner: Address) => Promise<boolean>;
getOwners: () => Promise<string[]>;
getRequired: () => Promise<BigNumber>;
getInternalRequired: () => Promise<BigNumber>;
totalTransactionCount: () => Promise<number>;
getTransactionCount: (pending: boolean, executed: boolean) => Promise<number>;
replaceOwner: (owner: Address, newOwner: Address) => CeloTransactionObject<void>;
getTransactionDataByContent(destination: string, txo: CeloTxObject<any>, value?: BigNumber.Value): Promise<{
confirmations: string[];
destination: string;
value: BigNumber;
data: string;
executed: boolean;
index: number;
} | undefined>;
getTransaction(i: number): Promise<TransactionData>;
getTransaction(i: number, includeConfirmations: false): Promise<TransactionDataWithOutConfirmations>;
getConfirmations(txId: number): Promise<string[]>;
getTransactions(): Promise<TransactionData[]>;
}
export type MultiSigWrapperType = MultiSigWrapper;