@celo/contractkit
Version:
Celo's ContractKit to interact with Celo network
112 lines (111 loc) • 7.58 kB
TypeScript
import { newAccounts } from '@celo/abis/web3/Accounts';
import { newAttestations } from '@celo/abis/web3/Attestations';
import { newCeloUnreleasedTreasury } from '@celo/abis/web3/CeloUnreleasedTreasury';
import { newElection } from '@celo/abis/web3/Election';
import { newEpochManager } from '@celo/abis/web3/EpochManager';
import { newEpochManagerEnabler } from '@celo/abis/web3/EpochManagerEnabler';
import { newEpochRewards } from '@celo/abis/web3/EpochRewards';
import { newEscrow } from '@celo/abis/web3/Escrow';
import { newFederatedAttestations } from '@celo/abis/web3/FederatedAttestations';
import { newFeeCurrencyDirectory } from '@celo/abis/web3/FeeCurrencyDirectory';
import { newFeeHandler } from '@celo/abis/web3/FeeHandler';
import { newFreezer } from '@celo/abis/web3/Freezer';
import { newGoldToken } from '@celo/abis/web3/GoldToken';
import { newGovernance } from '@celo/abis/web3/Governance';
import { newGovernanceSlasher } from '@celo/abis/web3/GovernanceSlasher';
import { newIERC20 } from '@celo/abis/web3/IERC20';
import { newLockedGold } from '@celo/abis/web3/LockedGold';
import { newReserve } from '@celo/abis/web3/mento/Reserve';
import { newStableToken } from '@celo/abis/web3/mento/StableToken';
import { newMentoFeeHandlerSeller } from '@celo/abis/web3/MentoFeeHandlerSeller';
import { newMultiSig } from '@celo/abis/web3/MultiSig';
import { newOdisPayments } from '@celo/abis/web3/OdisPayments';
import { newRegistry } from '@celo/abis/web3/Registry';
import { newScoreManager } from '@celo/abis/web3/ScoreManager';
import { newSortedOracles } from '@celo/abis/web3/SortedOracles';
import { newUniswapFeeHandlerSeller } from '@celo/abis/web3/UniswapFeeHandlerSeller';
import { newValidators } from '@celo/abis/web3/Validators';
import { AddressRegistry } from './address-registry';
import { StableToken } from './celo-tokens';
export declare const ContractFactories: {
Accounts: typeof newAccounts;
Attestations: typeof newAttestations;
CeloUnreleasedTreasury: typeof newCeloUnreleasedTreasury;
Election: typeof newElection;
EpochManager: typeof newEpochManager;
EpochManagerEnabler: typeof newEpochManagerEnabler;
EpochRewards: typeof newEpochRewards;
ERC20: typeof newIERC20;
Escrow: typeof newEscrow;
FederatedAttestations: typeof newFederatedAttestations;
FeeCurrencyDirectory: typeof newFeeCurrencyDirectory;
Freezer: typeof newFreezer;
FeeHandler: typeof newFeeHandler;
MentoFeeHandlerSeller: typeof newMentoFeeHandlerSeller;
UniswapFeeHandlerSeller: typeof newUniswapFeeHandlerSeller;
CeloToken: typeof newGoldToken;
GoldToken: typeof newGoldToken;
Governance: typeof newGovernance;
GovernanceSlasher: typeof newGovernanceSlasher;
LockedCelo: typeof newLockedGold;
LockedGold: typeof newLockedGold;
MultiSig: typeof newMultiSig;
OdisPayments: typeof newOdisPayments;
Registry: typeof newRegistry;
Reserve: typeof newReserve;
ScoreManager: typeof newScoreManager;
SortedOracles: typeof newSortedOracles;
StableToken: typeof newStableToken;
StableTokenEUR: typeof newStableToken;
StableTokenBRL: typeof newStableToken;
Validators: typeof newValidators;
};
export type CFType = typeof ContractFactories;
type ContractCacheMap = {
[K in keyof CFType]?: ReturnType<CFType[K]>;
};
/**
* Native Web3 contracts factory and cache.
*
* Exposes accessors to all `CeloContract` web3 contracts.
*
* Mostly a private cache, kit users would normally use
* a contract wrapper
*/
export declare class Web3ContractCache {
readonly registry: AddressRegistry;
private cacheMap;
/** core contract's address registry */
constructor(registry: AddressRegistry);
getAccounts(): Promise<import("@celo/abis/web3/Accounts").Accounts>;
getAttestations(): Promise<import("@celo/abis/web3/Attestations").Attestations>;
getCeloUnreleasedTreasury(): Promise<import("@celo/abis/web3/CeloUnreleasedTreasury").CeloUnreleasedTreasury>;
getElection(): Promise<import("@celo/abis/web3/Election").Election>;
getEpochManager(): Promise<import("@celo/abis/web3/EpochManager").EpochManager>;
getEpochManagerEnabler(): Promise<import("@celo/abis/web3/EpochManagerEnabler").EpochManagerEnabler>;
getEpochRewards(): Promise<import("@celo/abis/web3/EpochRewards").EpochRewards>;
getErc20(address: string): Promise<import("@celo/abis/web3/IERC20").IERC20>;
getEscrow(): Promise<import("@celo/abis/web3/Escrow").Escrow>;
getFederatedAttestations(): Promise<import("@celo/abis/web3/FederatedAttestations").FederatedAttestations>;
getFreezer(): Promise<import("@celo/abis/web3/Freezer").Freezer>;
getFeeHandler(): Promise<import("@celo/abis/web3/FeeHandler").FeeHandler>;
getGoldToken(): Promise<import("@celo/abis/web3/GoldToken").GoldToken>;
getCeloToken(): Promise<import("@celo/abis/web3/GoldToken").GoldToken>;
getGovernance(): Promise<import("@celo/abis/web3/Governance").Governance>;
getLockedGold(): Promise<import("@celo/abis/web3/LockedGold").LockedGold>;
getLockedCelo(): Promise<import("@celo/abis/web3/LockedGold").LockedGold>;
getMultiSig(address: string): Promise<import("@celo/abis/web3/MultiSig").MultiSig>;
getOdisPayments(): Promise<import("@celo/abis/web3/OdisPayments").OdisPayments>;
getRegistry(): Promise<import("@celo/abis/web3/Registry").Registry>;
getReserve(): Promise<import("@celo/abis/web3/mento/Reserve").Reserve>;
getScoreManager(): Promise<import("@celo/abis/web3/ScoreManager").ScoreManager>;
getSortedOracles(): Promise<import("@celo/abis/web3/SortedOracles").SortedOracles>;
getStableToken(stableToken?: StableToken): Promise<NonNullable<import("@celo/abis/web3/Registry").Registry | import("@celo/abis/web3/Accounts").Accounts | import("@celo/abis/web3/IERC20").IERC20 | import("@celo/abis/web3/GoldToken").GoldToken | import("@celo/abis/web3/mento/StableToken").StableToken | import("@celo/abis/web3/Attestations").Attestations | import("@celo/abis/web3/CeloUnreleasedTreasury").CeloUnreleasedTreasury | import("@celo/abis/web3/Election").Election | import("@celo/abis/web3/EpochManager").EpochManager | import("@celo/abis/web3/EpochManagerEnabler").EpochManagerEnabler | import("@celo/abis/web3/EpochRewards").EpochRewards | import("@celo/abis/web3/Escrow").Escrow | import("@celo/abis/web3/FederatedAttestations").FederatedAttestations | import("@celo/abis/web3/FeeCurrencyDirectory").FeeCurrencyDirectory | import("@celo/abis/web3/Freezer").Freezer | import("@celo/abis/web3/FeeHandler").FeeHandler | import("@celo/abis/web3/MentoFeeHandlerSeller").MentoFeeHandlerSeller | import("@celo/abis/web3/UniswapFeeHandlerSeller").UniswapFeeHandlerSeller | import("@celo/abis/web3/Governance").Governance | import("@celo/abis/web3/GovernanceSlasher").GovernanceSlasher | import("@celo/abis/web3/LockedGold").LockedGold | import("@celo/abis/web3/MultiSig").MultiSig | import("@celo/abis/web3/OdisPayments").OdisPayments | import("@celo/abis/web3/mento/Reserve").Reserve | import("@celo/abis/web3/ScoreManager").ScoreManager | import("@celo/abis/web3/SortedOracles").SortedOracles | import("@celo/abis/web3/Validators").Validators | undefined>>;
getValidators(): Promise<import("@celo/abis/web3/Validators").Validators>;
/**
* Get native web3 contract wrapper
*/
getContract<C extends keyof typeof ContractFactories>(contract: C, address?: string): Promise<NonNullable<ContractCacheMap[C]>>;
invalidateContract<C extends keyof typeof ContractFactories>(contract: C): void;
}
export {};