PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@celo/contractkit/lib

Просмотр файла: kit.d.ts

import { Address, CeloTx, CeloTxObject, Connection, ReadOnlyWallet, TransactionResult } from '@celo/connect';
import { EIP712TypedData } from '@celo/utils/lib/sign-typed-data-utils';
import { Signature } from '@celo/utils/lib/signatureUtils';
import { BigNumber } from 'bignumber.js';
import Web3 from 'web3';
import { AddressRegistry } from './address-registry';
import { CeloContract, CeloTokenContract } from './base';
import { CeloTokens, EachCeloToken } from './celo-tokens';
import { WrapperCache } from './contract-cache';
import { HttpProviderOptions } from './setupForKits';
import { Web3ContractCache } from './web3-contract-cache';
import { AttestationsConfig } from './wrappers/Attestations';
import { BlockchainParametersConfig } from './wrappers/BlockchainParameters';
import { DowntimeSlasherConfig } from './wrappers/DowntimeSlasher';
import { ElectionConfig } from './wrappers/Election';
import { ExchangeConfig } from './wrappers/Exchange';
import { GasPriceMinimumConfig } from './wrappers/GasPriceMinimum';
import { GovernanceConfig } from './wrappers/Governance';
import { GrandaMentoConfig } from './wrappers/GrandaMento';
import { LockedGoldConfig } from './wrappers/LockedGold';
import { ReserveConfig } from './wrappers/Reserve';
import { SortedOraclesConfig } from './wrappers/SortedOracles';
import { StableTokenConfig } from './wrappers/StableTokenWrapper';
import { ValidatorsConfig } from './wrappers/Validators';
export { API_KEY_HEADER_KEY, HttpProviderOptions } from './setupForKits';
/**
 * Creates a new instance of `ContractKit` given a nodeUrl
 * @param url CeloBlockchain node url
 * @optional wallet to reuse or add a wallet different than the default (example ledger-wallet)
 * @optional options to pass to the Web3 HttpProvider constructor
 */
export declare function newKit(url: string, wallet?: ReadOnlyWallet, options?: HttpProviderOptions): ContractKit;
/**
 * Creates a new instance of `ContractKit` given a nodeUrl and apiKey
 * @param url CeloBlockchain node url
 * @param apiKey to include in the http request header
 * @optional wallet to reuse or add a wallet different than the default (example ledger-wallet)
 */
export declare function newKitWithApiKey(url: string, apiKey: string, wallet?: ReadOnlyWallet): ContractKit;
/**
 * Creates a new instance of the `ContractKit` with a web3 instance
 * @param web3 Web3 instance
 */
export declare function newKitFromWeb3(web3: Web3, wallet?: ReadOnlyWallet): ContractKit;
export interface NetworkConfig {
    exchanges: EachCeloToken<ExchangeConfig>;
    stableTokens: EachCeloToken<StableTokenConfig>;
    election: ElectionConfig;
    attestations: AttestationsConfig;
    governance: GovernanceConfig;
    lockedGold: LockedGoldConfig;
    sortedOracles: SortedOraclesConfig;
    gasPriceMinimum: GasPriceMinimumConfig;
    reserve: ReserveConfig;
    validators: ValidatorsConfig;
    downtimeSlasher: DowntimeSlasherConfig;
    blockchainParameters: BlockchainParametersConfig;
    grandaMento: GrandaMentoConfig;
}
interface AccountBalance extends EachCeloToken<BigNumber> {
    lockedCELO: BigNumber;
    pending: BigNumber;
}
export declare class ContractKit {
    readonly connection: Connection;
    /** core contract's address registry */
    readonly registry: AddressRegistry;
    /** factory for core contract's native web3 wrappers  */
    readonly _web3Contracts: Web3ContractCache;
    /** factory for core contract's kit wrappers  */
    readonly contracts: WrapperCache;
    /** helper for interacting with CELO & stable tokens */
    readonly celoTokens: CeloTokens;
    /** @deprecated no longer needed since gasPrice is available on minimumClientVersion node rpc */
    gasPriceSuggestionMultiplier: number;
    constructor(connection: Connection);
    getWallet(): ReadOnlyWallet | undefined;
    getTotalBalance(address: string): Promise<AccountBalance>;
    getNetworkConfig(humanReadable?: boolean): Promise<NetworkConfig | Record<CeloContract & 'exchanges' & 'stableTokens', unknown>>;
    getHumanReadableNetworkConfig: () => Promise<NetworkConfig | Record<never, unknown>>;
    /**
     * Set CeloToken to use to pay for gas fees
     * @param tokenContract CELO (GoldToken) or a supported StableToken contract
     */
    setFeeCurrency(tokenContract: CeloTokenContract): Promise<void>;
    /** @deprecated no longer needed since gasPrice is available on minimumClientVersion node rpc */
    updateGasPriceInConnectionLayer(currency: Address): Promise<void>;
    getEpochSize(): Promise<number>;
    getFirstBlockNumberForEpoch(epochNumber: number): Promise<number>;
    getLastBlockNumberForEpoch(epochNumber: number): Promise<number>;
    getEpochNumberOfBlock(blockNumber: number): Promise<number>;
    addAccount(privateKey: string): void;
    set defaultAccount(address: Address | undefined);
    get defaultAccount(): Address | undefined;
    set gasInflationFactor(factor: number);
    get gasInflationFactor(): number;
    set gasPrice(price: number);
    get gasPrice(): number;
    set defaultFeeCurrency(address: Address | undefined);
    get defaultFeeCurrency(): Address | undefined;
    isListening(): Promise<boolean>;
    isSyncing(): Promise<boolean>;
    /** @deprecated no longer needed since gasPrice is available on minimumClientVersion node rpc */
    fillGasPrice(tx: CeloTx): Promise<CeloTx>;
    sendTransaction(tx: CeloTx): Promise<TransactionResult>;
    sendTransactionObject(txObj: CeloTxObject<any>, tx?: Omit<CeloTx, 'data'>): Promise<TransactionResult>;
    signTypedData(signer: string, typedData: EIP712TypedData): Promise<Signature>;
    stop(): void;
    get web3(): Web3;
}

Выполнить команду


Для локальной разработки. Не используйте в интернете!