import { Interfaces } from '@open-rights-exchange/chain-js'; import { AlgorandCreateAccountOptions, AlgorandEntityName, AlgorandNewAccountType } from './models'; import { AlgorandChainState } from './algoChainState'; /** 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 AlgorandCreateAccount implements Interfaces.CreateAccount { private _publicKey; private _chainState; private _accountType; private _options; requiresTransaction: boolean; private _generatedKeys; constructor(chainState: AlgorandChainState, options?: AlgorandCreateAccountOptions); init(): Promise; /** Returns whether the transaction is a multisig transaction */ get isMultisig(): boolean; /** Account name for the account to be created * May be automatically generated (or otherwise changed) by composeTransaction() */ get accountName(): AlgorandEntityName; /** Account type to be created */ get accountType(): AlgorandNewAccountType; /** 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").AlgorandKeyPair; /** Account creation options */ get options(): AlgorandCreateAccountOptions; /** Algorand does not require the chain to execute a createAccount transaction * to create the account structure on-chain */ get supportsTransactionToCreateAccount(): boolean; /** Algorand account creation doesn't require any on chain transactions. * Hence there is no transaction object attached to AlgorandCreateAccount class */ get transaction(): any; /** Compose a transaction to send to the chain to create a new account * Algorand does not require a create account transaction to be sent to the chain */ composeTransaction(): Promise; /** Determine if desired account name is usable for a new account. * Recycling is not supported for now. Will be supported in the future. */ determineNewAccountName(accountName: AlgorandEntityName): Promise; /** Returns the Algorand Address as AlgorandEntityName 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 both publicKey and multisigOptions are missing, * autogenerate the public and private key pair and add them to options * Algorand keys are represented as hex strings in chainjs. * These keys are converted to Uint8Array when passed to Algorand sdk and nacl (crypto library for algorand). */ generateKeysIfNeeded(): Promise; private generateAccountKeys; /** make sure all options passed-in are valid */ private assertValidOptions; /** Before encrypting keys, check for required options (password and salt) */ private assertValidOptionNewKeys; }