nxt.account

## Class Account

- java.lang.Object
- - nxt.account.Account

-     public final class Account
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Account.AccountAsset`
    `static class` | `Account.AccountCurrency`
    `static class` | `Account.AccountInfo`
    `static class` | `Account.AccountLease`
    `static class` | `Account.AccountProperty`
    `static class` | `Account.ControlType`
    `static class` | `Account.Event`
    `static class` | `Account.PublicKey`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static StringRw` | `PROPERTY_NAME_RW`
    `static StringRw` | `PROPERTY_VALUE_RW`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `addAssetListener(Listener<Account.AccountAsset> listener, Account.Event eventType)`
    `static boolean` | `addCurrencyListener(Listener<Account.AccountCurrency> listener, Account.Event eventType)`
    `static boolean` | `addLeaseListener(Listener<Account.AccountLease> listener, Account.Event eventType)`
    `static Account` | `addOrGetAccount(long id)`
    `static boolean` | `addPropertyListener(Listener<Account.AccountProperty> listener, Account.Event eventType)`
    `void` | `addToAssetAndUnconfirmedAssetBalanceQNT(AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long assetId, long quantityQNT)`
    `void` | `addToAssetBalanceQNT(AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long assetId, long quantityQNT)`
    `void` | `addToBalance(Chain chain, AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long amount)`
    `void` | `addToBalance(Chain chain, AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long amount, long fee)`
    `void` | `addToBalanceAndUnconfirmedBalance(Chain chain, AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long amount)`
    `void` | `addToBalanceAndUnconfirmedBalance(Chain chain, AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long amount, long fee)`
    `void` | `addToCurrencyAndUnconfirmedCurrencyUnits(AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long currencyId, long units)`
    `void` | `addToCurrencyUnits(AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long currencyId, long units)`
    `void` | `addToForgedBalanceFQT(long amount)`
    `void` | `addToUnconfirmedAssetBalanceQNT(AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long assetId, long quantityQNT)`
    `void` | `addToUnconfirmedBalance(Chain chain, AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long amount)`
    `void` | `addToUnconfirmedBalance(Chain chain, AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long amount, long fee)`
    `void` | `addToUnconfirmedCurrencyUnits(AccountLedger.LedgerEvent event, AccountLedger.LedgerEventId eventId, long currencyId, long units)`
    `void` | `apply(byte[] key)`
    `static byte[]` | `decryptFrom(byte[] publicKey, EncryptedData encryptedData, java.lang.String recipientSecretPhrase, boolean uncompress)`
    `byte[]` | `decryptFrom(EncryptedData encryptedData, java.lang.String recipientSecretPhrase, boolean uncompress)`
    `void` | `deleteProperty(long propertyId)`
    `static EncryptedData` | `encryptTo(byte[] publicKey, byte[] data, java.lang.String senderSecretPhrase, boolean compress)`
    `EncryptedData` | `encryptTo(byte[] data, java.lang.String senderSecretPhrase, boolean compress)`
    `static Account` | `getAccount(byte[] publicKey)`
    `static Account` | `getAccount(long id)`
    `static Account` | `getAccount(long id, int height)`
    `static Account.AccountAsset` | `getAccountAsset(long accountId, long assetId)`
    `static Account.AccountAsset` | `getAccountAsset(long accountId, long assetId, int height)`
    `static int` | `getAccountAssetCount(long accountId)`
    `static int` | `getAccountAssetCount(long accountId, int height)`
    `static DbIterator<Account.AccountAsset>` | `getAccountAssets(long accountId, int from, int to)`
    `static DbIterator<Account.AccountAsset>` | `getAccountAssets(long accountId, int height, int from, int to)`
    `static DbIterator<Account.AccountCurrency>` | `getAccountCurrencies(long accountId, int from, int to)`
    `static DbIterator<Account.AccountCurrency>` | `getAccountCurrencies(long accountId, int height, int from, int to)`
    `static Account.AccountCurrency` | `getAccountCurrency(long accountId, long currencyId)`
    `static Account.AccountCurrency` | `getAccountCurrency(long accountId, long currencyId, int height)`
    `static int` | `getAccountCurrencyCount(long accountId)`
    `static int` | `getAccountCurrencyCount(long accountId, int height)`
    `Account.AccountInfo` | `getAccountInfo()`
    `Account.AccountLease` | `getAccountLease()`
    `static int` | `getAccountLeaseCount()`
    `static int` | `getActiveLeaseCount()`
    `Account.AccountAsset` | `getAsset(long assetId)`
    `Account.AccountAsset` | `getAsset(long assetId, int height)`
    `static int` | `getAssetAccountCount(long assetId)`
    `static int` | `getAssetAccountCount(long assetId, int height)`
    `static DbIterator<Account.AccountAsset>` | `getAssetAccounts(long assetId, int from, int to)`
    `static DbIterator<Account.AccountAsset>` | `getAssetAccounts(long assetId, int height, int from, int to)`
    `long` | `getAssetBalanceQNT(long assetId)`
    `long` | `getAssetBalanceQNT(long assetId, int height)`
    `static long` | `getAssetBalanceQNT(long accountId, long assetId)`
    `static long` | `getAssetBalanceQNT(long accountId, long assetId, int height)`
    `DbIterator<Account.AccountAsset>` | `getAssets(int from, int to)`
    `DbIterator<Account.AccountAsset>` | `getAssets(int height, int from, int to)`
    `DbIterator<AssetTransfer>` | `getAssetTransfers(int from, int to)`
    `java.util.Set<Account.ControlType>` | `getControls()`
    `static int` | `getCount()`
    `DbIterator<Account.AccountCurrency>` | `getCurrencies(int from, int to)`
    `DbIterator<Account.AccountCurrency>` | `getCurrencies(int height, int from, int to)`
    `Account.AccountCurrency` | `getCurrency(long currencyId)`
    `Account.AccountCurrency` | `getCurrency(long currencyId, int height)`
    `static int` | `getCurrencyAccountCount(long currencyId)`
    `static int` | `getCurrencyAccountCount(long currencyId, int height)`
    `static DbIterator<Account.AccountCurrency>` | `getCurrencyAccounts(long currencyId, int from, int to)`
    `static DbIterator<Account.AccountCurrency>` | `getCurrencyAccounts(long currencyId, int height, int from, int to)`
    `DbIterator<CurrencyTransfer>` | `getCurrencyTransfers(int from, int to)`
    `long` | `getCurrencyUnits(long currencyId)`
    `long` | `getCurrencyUnits(long currencyId, int height)`
    `static long` | `getCurrencyUnits(long accountId, long currencyId)`
    `static long` | `getCurrencyUnits(long accountId, long currencyId, int height)`
    `long` | `getEffectiveBalanceFXT()`
    `long` | `getEffectiveBalanceFXT(int height)`
    `DbIterator<ExchangeHome.Exchange>` | `getExchanges(ChildChain childChain, int from, int to)`
    `long` | `getForgedBalanceFQT()`
    `long` | `getGuaranteedBalanceFQT()`
    `long` | `getGuaranteedBalanceFQT(int numberOfConfirmations, int currentHeight)`
    `long` | `getId()`
    `static long` | `getId(byte[] publicKey)`
    `DbIterator<Account>` | `getLessors()`
    `DbIterator<Account>` | `getLessors(int height)`
    `static DbIterator<Account.AccountProperty>` | `getProperties(long recipientId, long setterId, java.lang.String property, int from, int to)`
    `static Account.AccountProperty` | `getProperty(long propertyId)`
    `static Account.AccountProperty` | `getProperty(long recipientId, java.lang.String property)`
    `static Account.AccountProperty` | `getProperty(long recipientId, java.lang.String property, long setterId)`
    `static byte[]` | `getPublicKey(long id)`
    `DbIterator<TradeHome.Trade>` | `getTrades(ChildChain childChain, int from, int to)`
    `long` | `getUnconfirmedAssetBalanceQNT(long assetId)`
    `static long` | `getUnconfirmedAssetBalanceQNT(long accountId, long assetId)`
    `long` | `getUnconfirmedCurrencyUnits(long currencyId)`
    `static long` | `getUnconfirmedCurrencyUnits(long accountId, long currencyId)`
    `static boolean` | `hasAccount(long id, int height)`
    `static void` | `importProperty(long propertyId, long recipientId, long setterId, java.lang.String property, java.lang.String value)`
    `static void` | `init()`
    `void` | `leaseEffectiveBalance(long lesseeId, int period)`
    `static boolean` | `removeAssetListener(Listener<Account.AccountAsset> listener, Account.Event eventType)`
    `static boolean` | `removeCurrencyListener(Listener<Account.AccountCurrency> listener, Account.Event eventType)`
    `static boolean` | `removeLeaseListener(Listener<Account.AccountLease> listener, Account.Event eventType)`
    `static boolean` | `removePropertyListener(Listener<Account.AccountProperty> listener, Account.Event eventType)`
    `static DbIterator<Account.AccountInfo>` | `searchAccounts(java.lang.String query, int from, int to)`
    `void` | `setAccountInfo(java.lang.String name, java.lang.String description)`
    `static boolean` | `setOrVerify(long accountId, byte[] key)`
    `void` | `setProperty(Transaction transaction, Account setterAccount, java.lang.String property, java.lang.String value)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### PROPERTY_NAME_RW

          public static final StringRw PROPERTY_NAME_RW

    - #### PROPERTY_VALUE_RW

          public static final StringRw PROPERTY_VALUE_RW

  - ### Method Detail

    - #### addAssetListener

          public static boolean addAssetListener(Listener<Account.AccountAsset> listener,
                                                 Account.Event eventType)

    - #### removeAssetListener

          public static boolean removeAssetListener(Listener<Account.AccountAsset> listener,
                                                    Account.Event eventType)

    - #### addCurrencyListener

          public static boolean addCurrencyListener(Listener<Account.AccountCurrency> listener,
                                                    Account.Event eventType)

    - #### removeCurrencyListener

          public static boolean removeCurrencyListener(Listener<Account.AccountCurrency> listener,
                                                       Account.Event eventType)

    - #### addLeaseListener

          public static boolean addLeaseListener(Listener<Account.AccountLease> listener,
                                                 Account.Event eventType)

    - #### removeLeaseListener

          public static boolean removeLeaseListener(Listener<Account.AccountLease> listener,
                                                    Account.Event eventType)

    - #### addPropertyListener

          public static boolean addPropertyListener(Listener<Account.AccountProperty> listener,
                                                    Account.Event eventType)

    - #### removePropertyListener

          public static boolean removePropertyListener(Listener<Account.AccountProperty> listener,
                                                       Account.Event eventType)

    - #### getCount

          public static int getCount()

    - #### getAssetAccountCount

          public static int getAssetAccountCount(long assetId)

    - #### getAssetAccountCount

          public static int getAssetAccountCount(long assetId,
                                                 int height)

    - #### getAccountAssetCount

          public static int getAccountAssetCount(long accountId)

    - #### getAccountAssetCount

          public static int getAccountAssetCount(long accountId,
                                                 int height)

    - #### getCurrencyAccountCount

          public static int getCurrencyAccountCount(long currencyId)

    - #### getCurrencyAccountCount

          public static int getCurrencyAccountCount(long currencyId,
                                                    int height)

    - #### getAccountCurrencyCount

          public static int getAccountCurrencyCount(long accountId)

    - #### getAccountCurrencyCount

          public static int getAccountCurrencyCount(long accountId,
                                                    int height)

    - #### getAccountLeaseCount

          public static int getAccountLeaseCount()

    - #### getActiveLeaseCount

          public static int getActiveLeaseCount()

    - #### getProperty

          public static Account.AccountProperty getProperty(long propertyId)

    - #### getProperties

          public static DbIterator<Account.AccountProperty> getProperties(long recipientId,
                                                                          long setterId,
                                                                          java.lang.String property,
                                                                          int from,
                                                                          int to)

    - #### getProperty

          public static Account.AccountProperty getProperty(long recipientId,
                                                            java.lang.String property)

    - #### getProperty

          public static Account.AccountProperty getProperty(long recipientId,
                                                            java.lang.String property,
                                                            long setterId)

    - #### getAccount

          public static Account getAccount(long id)

    - #### getAccount

          public static Account getAccount(long id,
                                           int height)

    - #### hasAccount

          public static boolean hasAccount(long id,
                                           int height)

    - #### getAccount

          public static Account getAccount(byte[] publicKey)

    - #### getId

          public static long getId(byte[] publicKey)

    - #### getPublicKey

          public static byte[] getPublicKey(long id)

    - #### addOrGetAccount

          public static Account addOrGetAccount(long id)

    - #### getAccountAssets

          public static DbIterator<Account.AccountAsset> getAccountAssets(long accountId,
                                                                          int from,
                                                                          int to)

    - #### getAccountAssets

          public static DbIterator<Account.AccountAsset> getAccountAssets(long accountId,
                                                                          int height,
                                                                          int from,
                                                                          int to)

    - #### getAccountAsset

          public static Account.AccountAsset getAccountAsset(long accountId,
                                                             long assetId)

    - #### getAccountAsset

          public static Account.AccountAsset getAccountAsset(long accountId,
                                                             long assetId,
                                                             int height)

    - #### getAssetAccounts

          public static DbIterator<Account.AccountAsset> getAssetAccounts(long assetId,
                                                                          int from,
                                                                          int to)

    - #### getAssetAccounts

          public static DbIterator<Account.AccountAsset> getAssetAccounts(long assetId,
                                                                          int height,
                                                                          int from,
                                                                          int to)

    - #### getAccountCurrency

          public static Account.AccountCurrency getAccountCurrency(long accountId,
                                                                   long currencyId)

    - #### getAccountCurrency

          public static Account.AccountCurrency getAccountCurrency(long accountId,
                                                                   long currencyId,
                                                                   int height)

    - #### getAccountCurrencies

          public static DbIterator<Account.AccountCurrency> getAccountCurrencies(long accountId,
                                                                                 int from,
                                                                                 int to)

    - #### getAccountCurrencies

          public static DbIterator<Account.AccountCurrency> getAccountCurrencies(long accountId,
                                                                                 int height,
                                                                                 int from,
                                                                                 int to)

    - #### getCurrencyAccounts

          public static DbIterator<Account.AccountCurrency> getCurrencyAccounts(long currencyId,
                                                                                int from,
                                                                                int to)

    - #### getCurrencyAccounts

          public static DbIterator<Account.AccountCurrency> getCurrencyAccounts(long currencyId,
                                                                                int height,
                                                                                int from,
                                                                                int to)

    - #### getAssetBalanceQNT

          public static long getAssetBalanceQNT(long accountId,
                                                long assetId,
                                                int height)

    - #### getAssetBalanceQNT

          public static long getAssetBalanceQNT(long accountId,
                                                long assetId)

    - #### getUnconfirmedAssetBalanceQNT

          public static long getUnconfirmedAssetBalanceQNT(long accountId,
                                                           long assetId)

    - #### getCurrencyUnits

          public static long getCurrencyUnits(long accountId,
                                              long currencyId,
                                              int height)

    - #### getCurrencyUnits

          public static long getCurrencyUnits(long accountId,
                                              long currencyId)

    - #### getUnconfirmedCurrencyUnits

          public static long getUnconfirmedCurrencyUnits(long accountId,
                                                         long currencyId)

    - #### searchAccounts

          public static DbIterator<Account.AccountInfo> searchAccounts(java.lang.String query,
                                                                       int from,
                                                                       int to)

    - #### init

          public static void init()

    - #### getId

          public long getId()

    - #### getAccountInfo

          public Account.AccountInfo getAccountInfo()

    - #### setAccountInfo

          public void setAccountInfo(java.lang.String name,
                                     java.lang.String description)

    - #### getAccountLease

          public Account.AccountLease getAccountLease()

    - #### encryptTo

          public EncryptedData encryptTo(byte[] data,
                                         java.lang.String senderSecretPhrase,
                                         boolean compress)

    - #### encryptTo

          public static EncryptedData encryptTo(byte[] publicKey,
                                                byte[] data,
                                                java.lang.String senderSecretPhrase,
                                                boolean compress)

    - #### decryptFrom

          public byte[] decryptFrom(EncryptedData encryptedData,
                                    java.lang.String recipientSecretPhrase,
                                    boolean uncompress)

    - #### decryptFrom

          public static byte[] decryptFrom(byte[] publicKey,
                                           EncryptedData encryptedData,
                                           java.lang.String recipientSecretPhrase,
                                           boolean uncompress)

    - #### getForgedBalanceFQT

          public long getForgedBalanceFQT()

    - #### getEffectiveBalanceFXT

          public long getEffectiveBalanceFXT()

    - #### getEffectiveBalanceFXT

          public long getEffectiveBalanceFXT(int height)

    - #### getLessors

          public DbIterator<Account> getLessors()

    - #### getLessors

          public DbIterator<Account> getLessors(int height)

    - #### getGuaranteedBalanceFQT

          public long getGuaranteedBalanceFQT()

    - #### getGuaranteedBalanceFQT

          public long getGuaranteedBalanceFQT(int numberOfConfirmations,
                                              int currentHeight)

    - #### getAssets

          public DbIterator<Account.AccountAsset> getAssets(int from,
                                                            int to)

    - #### getAssets

          public DbIterator<Account.AccountAsset> getAssets(int height,
                                                            int from,
                                                            int to)

    - #### getTrades

          public DbIterator<TradeHome.Trade> getTrades(ChildChain childChain,
                                                       int from,
                                                       int to)

    - #### getAssetTransfers

          public DbIterator<AssetTransfer> getAssetTransfers(int from,
                                                             int to)

    - #### getCurrencyTransfers

          public DbIterator<CurrencyTransfer> getCurrencyTransfers(int from,
                                                                   int to)

    - #### getExchanges

          public DbIterator<ExchangeHome.Exchange> getExchanges(ChildChain childChain,
                                                                int from,
                                                                int to)

    - #### getAsset

          public Account.AccountAsset getAsset(long assetId)

    - #### getAsset

          public Account.AccountAsset getAsset(long assetId,
                                               int height)

    - #### getAssetBalanceQNT

          public long getAssetBalanceQNT(long assetId)

    - #### getAssetBalanceQNT

          public long getAssetBalanceQNT(long assetId,
                                         int height)

    - #### getUnconfirmedAssetBalanceQNT

          public long getUnconfirmedAssetBalanceQNT(long assetId)

    - #### getCurrency

          public Account.AccountCurrency getCurrency(long currencyId)

    - #### getCurrency

          public Account.AccountCurrency getCurrency(long currencyId,
                                                     int height)

    - #### getCurrencies

          public DbIterator<Account.AccountCurrency> getCurrencies(int from,
                                                                   int to)

    - #### getCurrencies

          public DbIterator<Account.AccountCurrency> getCurrencies(int height,
                                                                   int from,
                                                                   int to)

    - #### getCurrencyUnits

          public long getCurrencyUnits(long currencyId)

    - #### getCurrencyUnits

          public long getCurrencyUnits(long currencyId,
                                       int height)

    - #### getUnconfirmedCurrencyUnits

          public long getUnconfirmedCurrencyUnits(long currencyId)

    - #### getControls

          public java.util.Set<Account.ControlType> getControls()

    - #### leaseEffectiveBalance

          public void leaseEffectiveBalance(long lesseeId,
                                            int period)

    - #### setProperty

          public void setProperty(Transaction transaction,
                                  Account setterAccount,
                                  java.lang.String property,
                                  java.lang.String value)

    - #### importProperty

          public static void importProperty(long propertyId,
                                            long recipientId,
                                            long setterId,
                                            java.lang.String property,
                                            java.lang.String value)

    - #### deleteProperty

          public void deleteProperty(long propertyId)

    - #### setOrVerify

          public static boolean setOrVerify(long accountId,
                                            byte[] key)

    - #### apply

          public void apply(byte[] key)

    - #### addToAssetBalanceQNT

          public void addToAssetBalanceQNT(AccountLedger.LedgerEvent event,
                                           AccountLedger.LedgerEventId eventId,
                                           long assetId,
                                           long quantityQNT)

    - #### addToUnconfirmedAssetBalanceQNT

          public void addToUnconfirmedAssetBalanceQNT(AccountLedger.LedgerEvent event,
                                                      AccountLedger.LedgerEventId eventId,
                                                      long assetId,
                                                      long quantityQNT)

    - #### addToAssetAndUnconfirmedAssetBalanceQNT

          public void addToAssetAndUnconfirmedAssetBalanceQNT(AccountLedger.LedgerEvent event,
                                                              AccountLedger.LedgerEventId eventId,
                                                              long assetId,
                                                              long quantityQNT)

    - #### addToCurrencyUnits

          public void addToCurrencyUnits(AccountLedger.LedgerEvent event,
                                         AccountLedger.LedgerEventId eventId,
                                         long currencyId,
                                         long units)

    - #### addToUnconfirmedCurrencyUnits

          public void addToUnconfirmedCurrencyUnits(AccountLedger.LedgerEvent event,
                                                    AccountLedger.LedgerEventId eventId,
                                                    long currencyId,
                                                    long units)

    - #### addToCurrencyAndUnconfirmedCurrencyUnits

          public void addToCurrencyAndUnconfirmedCurrencyUnits(AccountLedger.LedgerEvent event,
                                                               AccountLedger.LedgerEventId eventId,
                                                               long currencyId,
                                                               long units)

    - #### addToBalance

          public void addToBalance(Chain chain,
                                   AccountLedger.LedgerEvent event,
                                   AccountLedger.LedgerEventId eventId,
                                   long amount,
                                   long fee)

    - #### addToUnconfirmedBalance

          public void addToUnconfirmedBalance(Chain chain,
                                              AccountLedger.LedgerEvent event,
                                              AccountLedger.LedgerEventId eventId,
                                              long amount,
                                              long fee)

    - #### addToBalanceAndUnconfirmedBalance

          public void addToBalanceAndUnconfirmedBalance(Chain chain,
                                                        AccountLedger.LedgerEvent event,
                                                        AccountLedger.LedgerEventId eventId,
                                                        long amount,
                                                        long fee)

    - #### addToBalance

          public void addToBalance(Chain chain,
                                   AccountLedger.LedgerEvent event,
                                   AccountLedger.LedgerEventId eventId,
                                   long amount)

    - #### addToUnconfirmedBalance

          public void addToUnconfirmedBalance(Chain chain,
                                              AccountLedger.LedgerEvent event,
                                              AccountLedger.LedgerEventId eventId,
                                              long amount)

    - #### addToBalanceAndUnconfirmedBalance

          public void addToBalanceAndUnconfirmedBalance(Chain chain,
                                                        AccountLedger.LedgerEvent event,
                                                        AccountLedger.LedgerEventId eventId,
                                                        long amount)

    - #### addToForgedBalanceFQT

          public void addToForgedBalanceFQT(long amount)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`