import { Interfaces, PluginInterfaces } from '@open-rights-exchange/chain-js'; import { EthereumChainState } from './ethChainState'; import { EthereumAddress, EthereumCreateAccountOptions, EthereumEntityName, EthereumNewAccountType, EthereumTransactionOptions } from './models'; import { EthereumMultisigPluginCreateAccount } from './plugins/multisig/ethereumMultisigPlugin'; import { EthereumTransaction } from './ethTransaction'; /** Helper class to compose a transction for creating a new chain account * Handles native accounts * Generates new account keys if not provide */ export declare class EthereumCreateAccount implements Interfaces.CreateAccount { private _accountName; private _chainState; private _multisigPlugin; private _multisigCreateAccount; private _accountType; private _options; private _generatedKeys; private _transaction; constructor(chainState: EthereumChainState, options?: EthereumCreateAccountOptions, multisigPlugin?: PluginInterfaces.MultisigPlugin); init(): Promise; get multisigPlugin(): PluginInterfaces.MultisigPlugin; get multisigCreateAccount(): EthereumMultisigPluginCreateAccount; /** Account name for the account to be created * May be automatically generated (or otherwise changed) by composeTransaction() */ get accountName(): EthereumAddress; /** Account type to be created */ get accountType(): EthereumNewAccountType; /** Account will be recycled (accountName must be specified via composeTransaction() * This is set by composeTransaction() * ... if the account name provided has the 'unused' key as its active public key */ get didRecycleAccount(): boolean; /** The keys that were generated as part of the account creation process * IMPORTANT: Be sure to always read and store these keys after creating an account * This is the only way to retrieve the auto-generated private keys after an account is created */ get generatedKeys(): import("./models").EthereumKeyPair; /** Account creation options */ get options(): EthereumCreateAccountOptions; /** ETH does not require the chain to execute a createAccount transaction * to create the account structure on-chain */ get supportsTransactionToCreateAccount(): boolean; /** Returns whether the transaction is a multisig transaction */ get isMultisig(): boolean; get requiresTransaction(): boolean; /** If not multisig: ethereum account creation doesn't require any on chain transactions. * If multisig, it checks if transaction to chain is required, returns chain transaction if true */ get transaction(): EthereumTransaction; /** The transaction with all actions needed to create the account * This should be signed and sent to the chain to create the account */ /** Compose a transaction to send to the chain to create a new account * Ethereum may only require a create account transaction to be sent * If creating multisig account */ composeTransaction( /** Account Type is not required for Ethereum */ _accountType?: EthereumNewAccountType, // we don't need a value here - we inlcude _accountType here to implement the interface transactionOptions?: EthereumTransactionOptions): Promise; /** Determine if desired account name is usable for a new account. * Recycling is not supported on Ethereum */ determineNewAccountName(accountName: EthereumEntityName): Promise; /** Returns the Ethereum Address as EthereumEntityName for the public key provided in options OR generates a new private/public/address Updates generatedKeys for the newly generated name (since name/account is derived from publicKey */ generateAccountName(): Promise; generateAccountNameString(): Promise; /** Checks create options - if publicKeys are missing, * autogenerate the public and private key pair and add them to options */ generateKeysIfNeeded(): Promise; private generateAccountKeys; private assertValidOptionPublicKeys; private assertValidOptionNewKeys; /** If multisig plugin is required, make sure its initialized */ private assertHasMultisigPlugin; /** If multisig plugin is required, make sure its initialized */ private assertMultisigPluginIsInitialized; }