import type { MessageHandler } from './MessageHandler'; import type { Balance, AccountMetadata, SyncOptions, AccountMeta, Address, SendParams, SendNativeTokensParams, SendNftParams, AddressWithUnspentOutputs, AliasOutputParams, FilterOptions, GenerateAddressOptions, CreateNativeTokenTransaction, CreateNativeTokenParams, MintNftParams, Node, OutputData, OutputParams, OutputsToClaim, PreparedTransactionData, Transaction, TransactionOptions, ParticipationOverview, ParticipationEventId, ParticipationEventStatus, ParticipationEventType, ParticipationEventWithNodes, ParticipationEventRegistrationOptions, ParticipationEventMap, GenerateAddressesOptions, Secp256k1EcdsaSignature, Ed25519Signature, ConsolidationParams, Bip44 } from '../types'; import type { SignedTransactionEssence } from '../types/signedTransactionEssence'; import type { BuildAliasOutputData, BuildBasicOutputData, BuildFoundryOutputData, BuildNftOutputData } from '../types/buildOutputData'; import type { HexEncodedAmount, HexEncodedString, IAliasOutput, IBasicOutput, IFoundryOutput, INftOutput, OutputTypes } from '@iota/types'; /** The Account class. */ export declare class Account { private meta; private messageHandler; constructor(accountMeta: AccountMeta, messageHandler: MessageHandler); /** * Build an `AliasOutput`. * @param data Options for building an `AliasOutput`. * @returns The built `AliasOutput`. */ buildAliasOutput(data: BuildAliasOutputData): Promise; /** * Build a `BasicOutput`. * @param data Options for building a `BasicOutput`. * @returns The built `BasicOutput`. */ buildBasicOutput(data: BuildBasicOutputData): Promise; /** * Build a `FoundryOutput`. * @param data Options for building a `FoundryOutput`. * @returns The built `FoundryOutput`. */ buildFoundryOutput(data: BuildFoundryOutputData): Promise; /** * Build an `NftOutput`. * @param data Options for building an `NftOutput`. * @returns The built `NftOutput`. */ buildNftOutput(data: BuildNftOutputData): Promise; /** * Burn native tokens. This doesn't require the foundry output which minted them, but will not increase * the foundries `melted_tokens` field, which makes it impossible to destroy the foundry output. Therefore it's * recommended to use melting, if the foundry output is available. * @param tokenId The native token id. * @param burnAmount The to be burned amount. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The transaction. */ burnNativeToken(tokenId: string, burnAmount: HexEncodedAmount, transactionOptions?: TransactionOptions): Promise; /** * Burn an nft output * @param nftId The NftId. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The transaction. */ burnNft(nftId: string, transactionOptions?: TransactionOptions): Promise; /** * Claim basic or nft outputs that have additional unlock conditions * to their `AddressUnlockCondition` from the account. * @param outputIds The outputs to claim. * @returns The resulting transaction. */ claimOutputs(outputIds: string[]): Promise; /** * Consolidate basic outputs with only an `AddressUnlockCondition` from an account * by sending them to an own address again if the output amount is greater or * equal to the output consolidation threshold. * @param params The consolidation parameters. * @returns The consolidation transaction. */ consolidateOutputs(params: ConsolidationParams): Promise; /** * `createAliasOutput` creates an alias output * @param params The alias output options. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns A transaction object. */ createAliasOutput(params?: AliasOutputParams, transactionOptions?: TransactionOptions): Promise; /** * Melt native tokens. This happens with the foundry output which minted them, by increasing its * `melted_tokens` field. * @param tokenId The native token id. * @param meltAmount To be melted amount. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The transaction. */ meltNativeToken(tokenId: string, meltAmount: HexEncodedAmount, transactionOptions?: TransactionOptions): Promise; deregisterParticipationEvent(eventId: ParticipationEventId): Promise; /** * Destroy an alias output. * @param aliasId The AliasId. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The transaction. */ destroyAlias(aliasId: string, transactionOptions?: TransactionOptions): Promise; /** * Function to destroy a foundry output with a circulating supply of 0. * Native tokens in the foundry (minted by other foundries) will be transactioned to the controlling alias. * @param foundryId The FoundryId. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The transaction. */ destroyFoundry(foundryId: string, transactionOptions?: TransactionOptions): Promise; /** * Generate a new unused address. * @param options Options for address generation. * @returns The address. */ generateEd25519Address(options?: GenerateAddressOptions): Promise
; /** * Generate new unused addresses. * @param amount The amount of addresses to generate. * @param options Options for address generation. * @returns The addresses. */ generateEd25519Addresses(amount: number, options?: GenerateAddressOptions): Promise; /** Generate EVM addresses */ generateEvmAddresses(generateAddressesOptions: GenerateAddressesOptions): Promise; /** * Verifies an ed25519 signature against a message. */ verifyEd25519Signature(signature: Ed25519Signature, message: HexEncodedString): Promise; /** * Verifies a Secp256k1Ecdsa signature against a message. */ verifySecp256k1EcdsaSignature(signature: Secp256k1EcdsaSignature, message: HexEncodedString): Promise; /** * Signs a message with a Secp256k1Ecdsa private key. */ signSecp256k1Ecdsa(message: HexEncodedString, chain: Bip44): Promise; /** * Get the account balance. * @returns The account balance. */ getBalance(): Promise; /** * Get the data for an output. * @param outputId The output to get. * @returns The `OutputData`. */ getOutput(outputId: string): Promise; getParticipationEvent(eventId: ParticipationEventId): Promise; getParticipationEventIds(node: Node, eventType?: ParticipationEventType): Promise; getParticipationEvents(): Promise; getParticipationEventStatus(eventId: ParticipationEventId): Promise; /** * Get a `FoundryOutput` by native token ID. It will try to get the foundry from * the account, if it isn't in the account it will try to get it from the node. * @param tokenId The native token ID to get the foundry for. * @returns The `FoundryOutput` that minted the token. */ getFoundryOutput(tokenId: string): Promise; /** * Get outputs with additional unlock conditions. * @param outputs The type of outputs to claim. * @returns The output IDs of the unlockable outputs. */ claimableOutputs(outputs: OutputsToClaim): Promise; /** * Get a transaction stored in the account. * @param transactionId The ID of the transaction to get. * @returns The transaction. */ getTransaction(transactionId: string): Promise; /** * Get the transaction with inputs of an incoming transaction stored in the account * List might not be complete, if the node pruned the data already * @param transactionId The ID of the transaction to get. * @returns The transaction. */ getIncomingTransaction(transactionId: string): Promise; /** * List all the addresses of the account. * @returns The addresses. */ addresses(): Promise; /** * List the addresses of the account with unspent outputs. * @returns The addresses. */ addressesWithUnspentOutputs(): Promise; /** * List all outputs of the account. * @param filterOptions Options to filter the to be returned outputs. * @returns The outputs with metadata. */ outputs(filterOptions?: FilterOptions): Promise; /** * List all the pending transactions of the account. * @returns The transactions. */ pendingTransactions(): Promise; /** * List all incoming transactions of the account. * @returns The incoming transactions with their inputs. */ incomingTransactions(): Promise<[string, Transaction][]>; /** * List all the transactions of the account. * @returns The transactions. */ transactions(): Promise; /** * List all the unspent outputs of the account. * @param filterOptions Options to filter the to be returned outputs. * @returns The outputs with metadata. */ unspentOutputs(filterOptions?: FilterOptions): Promise; /** * Get the accounts metadata. * @returns The accounts metadata. */ getMetadata(): AccountMetadata; /** * Calculate the minimum required storage deposit for an output. * @param output output to calculate the deposit amount for. * @returns The amount. */ minimumRequiredStorageDeposit(output: OutputTypes): Promise; /** * Mint additional native tokens. * @param tokenId The native token id. * @param mintAmount To be minted amount. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The minting transaction. */ mintNativeToken(tokenId: string, mintAmount: HexEncodedAmount, transactionOptions?: TransactionOptions): Promise; /** * Create a native token. * @param params The options for creating the token. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The creating transaction and the token ID. */ createNativeToken(params: CreateNativeTokenParams, transactionOptions?: TransactionOptions): Promise; /** * Mint nfts. * @param params The options for minting nfts. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The minting transaction. */ mintNfts(params: MintNftParams[], transactionOptions?: TransactionOptions): Promise; /** * Prepare an output for sending, useful for offline signing. * @param options The options for preparing an output. If the amount is * below the minimum required storage deposit, by default the remaining * amount will automatically be added with a `StorageDepositReturn` `UnlockCondition`, * when setting the `ReturnStrategy` to `gift`, the full minimum required * storage deposit will be sent to the recipient. When the assets contain * an nft id, the data from the existing `NftOutput` will be used, just with * the address unlock conditions replaced. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The prepared output. */ prepareOutput(params: OutputParams, transactionOptions?: TransactionOptions): Promise; /** * Prepare a send transaction, useful for offline signing. * @param params Address with amounts to send. * @param options The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The prepared transaction data. */ prepareSend(params: SendParams[], options?: TransactionOptions): Promise; /** * Prepare a transaction, useful for offline signing. * @param outputs Outputs to use in the transaction. * @param options The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The prepared transaction data. */ prepareTransaction(outputs: OutputTypes[], options?: TransactionOptions): Promise; registerParticipationEvents(options: ParticipationEventRegistrationOptions): Promise; /** * Request funds from a faucet. */ requestFundsFromFaucet(url: string, address: string): Promise; /** * Retries (promotes or reattaches) a transaction sent from the account for a provided transaction id until it's * included (referenced by a milestone). Returns the included block id. */ retryTransactionUntilIncluded(transactionId: string, interval?: number, maxAttempts?: number): Promise; /** * Send a transaction with amounts from input addresses. * @param params Addresses with amounts. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The sent transaction. */ send(params: SendParams[], transactionOptions?: TransactionOptions): Promise; /** * Send native tokens. * @param params Addresses amounts and native tokens. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The sent transaction. */ sendNativeTokens(params: SendNativeTokensParams[], transactionOptions?: TransactionOptions): Promise; /** * Send nft. * @param params Addresses and nft ids. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The sent transaction. */ sendNft(params: SendNftParams[], transactionOptions?: TransactionOptions): Promise; /** * Send outputs in a transaction. * @param outputs The outputs to send. * @param transactionOptions The options to define a `RemainderValueStrategy` * or custom inputs. * @returns The sent transaction. */ sendOutputs(outputs: OutputTypes[], transactionOptions?: TransactionOptions): Promise; /** * Set the alias for the account * @param alias The account alias to set. */ setAlias(alias: string): Promise; /** * Set the fallback SyncOptions for account syncing. * If storage is enabled, will persist during restarts. * @param options The sync options to set. */ setDefaultSyncOptions(options: SyncOptions): Promise; /** * Sign a prepared transaction, useful for offline signing. * @param preparedTransactionData The prepared transaction data to sign. * @returns The signed transaction essence. */ signTransactionEssence(preparedTransactionData: PreparedTransactionData): Promise; /** * Validate the transaction, submit it to a node and store it in the account. * @param signedTransactionData A signed transaction to submit and store. * @returns The sent transaction. */ submitAndStoreTransaction(signedTransactionData: SignedTransactionEssence): Promise; /** * Sync the account by fetching new information from the nodes. * Will also retry pending transactions if necessary. * A custom default can be set using setDefaultSyncOptions. * * @param options Optional synchronization options. * @returns The account balance. */ sync(options?: SyncOptions): Promise; vote(eventId?: ParticipationEventId, answers?: number[]): Promise; stopParticipating(eventId: ParticipationEventId): Promise; /** * Calculates the voting overview of an account. * @param eventIds Optional, filters participations only for provided events. * @returns ParticipationOverview */ getParticipationOverview(eventIds?: ParticipationEventId[]): Promise; increaseVotingPower(amount: string): Promise; decreaseVotingPower(amount: string): Promise; } //# sourceMappingURL=Account.d.ts.map