Options
All
  • Public
  • Public/Protected
  • All
Menu

TokenAccount contain the keys, chains, and balances.

Hierarchy

Index

Constructors

constructor

Properties

Private _accountStatuses

_accountStatuses: AccountStatuses

Private _controllers

_controllers: Controller[]

Private _feeRate

_feeRate: string

Private _feeType

_feeType: feeType

Private _issuerInfo

_issuerInfo: string

Private _name

_name: string

Private _settings

_settings: Settings

Private _symbol

_symbol: string

Private _tokenBalance

_tokenBalance: string

Private _tokenFeeBalance

_tokenFeeBalance: string

Private _totalSupply

_totalSupply: string

Accessors

accountStatuses

address

  • get address(): string

balance

  • get balance(): string
  • set balance(amount: string): void

balanceInLogos

  • get balanceInLogos(): string

chain

controllers

decimals

  • get decimals(): number

feeRate

  • get feeRate(): string
  • set feeRate(val: string): void

feeType

issuerInfo

  • get issuerInfo(): string
  • set issuerInfo(val: string): void

label

  • get label(): string
  • set label(label: string): void

name

  • get name(): string
  • set name(val: string): void

pendingBalance

  • get pendingBalance(): string
  • set pendingBalance(amount: string): void
  • The pending balance of the account in reason

    pending balance is balance minus the sends that are pending

    type

    {string}

    readonly

    Returns string

  • The pending balance of the account in reason

    pending balance is balance minus the sends that are pending

    Parameters

    • amount: string

    Returns void

pendingChain

  • get pendingChain(): Request[]
  • set pendingChain(val: Request[]): void
  • array of pending requests on the account

    These requests have been sent for consensus but we haven't heard back on if they are confirmed yet.

    type

    {Request[]}

    Returns Request[]

  • array of pending requests on the account

    These requests have been sent for consensus but we haven't heard back on if they are confirmed yet.

    Parameters

    Returns void

pendingRequestCount

  • get pendingRequestCount(): number

previous

  • get previous(): string
  • Return the previous request as hash

    type

    {string}

    readonly

    Returns string

    hash of the previous transaction

publicKey

  • get publicKey(): string

receiveChain

  • get receiveChain(): Request[]
  • set receiveChain(val: Request[]): void

receiveCount

  • get receiveCount(): number
  • Gets the total number of requests on the receive chain

    type

    {number} count of all the requests

    readonly

    Returns number

requestCount

  • get requestCount(): number

sequence

  • get sequence(): number

settings

symbol

  • get symbol(): string
  • set symbol(val: string): void

synced

  • get synced(): boolean
  • set synced(val: boolean): void

tokenBalance

  • get tokenBalance(): string
  • set tokenBalance(val: string): void
  • The balance of the token in the minor token unit

    type

    {string}

    readonly

    Returns string

  • The balance of the token in the minor token unit

    Parameters

    • val: string

    Returns void

tokenFeeBalance

  • get tokenFeeBalance(): string
  • set tokenFeeBalance(val: string): void
  • The total supply of the token in the minor token unit

    type

    {string}

    readonly

    Returns string

  • The total supply of the token in the minor token unit

    Parameters

    • val: string

    Returns void

tokenID

  • get tokenID(): string

totalSupply

  • get totalSupply(): string
  • set totalSupply(val: string): void
  • The total supply of the token in minor token

    type

    {string}

    readonly

    Returns string

  • The total supply of the token in minor token

    Parameters

    • val: string

    Returns void

type

  • get type(): "TokenAccount"
  • The type of the account (LogosAccount or TokenAccount)

    type

    {string}

    Returns "TokenAccount"

version

  • get version(): number

wallet

Methods

accountHasFunds

  • accountHasFunds(address: string, amount: string): Promise<boolean>
  • Validates if the account has enough token funds to complete the transaction

    Parameters

    • address: string

      Address of the controller you are checking

    • amount: string

      Amount you are checking for

    Returns Promise<boolean>

addConfirmedRequest

  • addConfirmedRequest(requestInfo: RpcRequest): Request
  • Adds a request to the appropriate chain

    Parameters

    • requestInfo: RpcRequest

      Request information from the RPC or MQTT

    Returns Request

addRequest

  • Adds the request to the pending chain and publishes it

    throws

    An exception if the pending balance is less than the required amount to adjust a users status

    Parameters

    • request: Request

      Request information from the RPC or MQTT

    Returns Promise<Request>

Protected addToReceiveChain

  • addToReceiveChain(request: Request): void

Protected addToSendChain

  • addToSendChain(request: Request): void

broadcastRequest

  • broadcastRequest(): Promise<Request>

controllerPrivilege

  • controllerPrivilege(address: string, privilege: RpcPrivileges): boolean
  • Validates if the token account contains the controller and the controller has the specified privilege

    Parameters

    • address: string

      Address of the controller you are checking

    • privilege: RpcPrivileges

      Privilege you are checking for

    Returns boolean

convertToMajor

  • convertToMajor(minorValue: string): string

convertToMinor

  • convertToMinor(majorValue: string): string

getAccountStatus

  • Returns the status of the given address for this token

    Parameters

    • address: string

      The address of the account

    Returns AccountStatus

    status of the account { whitelisted and frozen }

getChainRequest

  • getChainRequest(hash: string): Request
  • Finds the request object of the specified request hash in the confirmed chain

    Parameters

    • hash: string

      The hash of the request we are looking for

    Returns Request

    false if no request object of the specified hash was found

getPendingRequest

  • getPendingRequest(hash: string): Request
  • Finds the request object of the specified request hash in the pending chain

    Parameters

    • hash: string

      The hash of the request we are looking for

    Returns Request

    false if no request object of the specified hash was found

getPendingRequestsUpTo

  • getPendingRequestsUpTo(hash: string): Request[]
  • Gets the requests up to a certain hash from the pending chain

    Parameters

    • hash: string

      Hash of the request you wish to stop retrieving requests at

    Returns Request[]

    all the requests up to and including the specified request

getReceiveRequestsUpTo

  • getReceiveRequestsUpTo(hash: string): Request[]
  • Gets the requests up to a certain hash from the receive chain

    Parameters

    • hash: string

      Hash of the request you wish to stop retrieving requests at

    Returns Request[]

    all the requests up to and including the specified request

Protected getRecieveRequest

  • getRecieveRequest(hash: string): Request
  • Finds the request object of the specified request hash in the recieve chain

    Parameters

    • hash: string

      The hash of the request we are looking for

    Returns Request

    false if no request object of the specified hash was found

getRequest

  • getRequest(hash: string): Request
  • Finds the request object of the specified request hash

    Parameters

    • hash: string

      The hash of the request we are looking for

    Returns Request

    null if no request object of the specified hash was found

getRequestsUpTo

  • getRequestsUpTo(hash: string): Request[]
  • Gets the requests up to a certain hash from the send chain

    Parameters

    • hash: string

      Hash of the request you wish to stop retrieving requests at

    Returns Request[]

    all the requests up to and including the specified request

hasSetting

  • hasSetting(setting: RpcSettings): boolean
  • Validates if the token has the setting

    Parameters

    • setting: RpcSettings

      Token setting you are checking

    Returns boolean

isController

  • isController(address: string): boolean
  • Validates if the token account contains the controller

    Parameters

    • address: string

      Address of the logos account you are checking if they are a controller

    Returns boolean

isSynced

processRequest

  • processRequest(requestInfo: RpcRequest): Promise<void>
  • Confirms the request in the local chain

    throws

    An exception if the request is not found in the pending requests array

    throws

    An exception if the previous request does not match the last chain request

    throws

    An exception if the request amount is greater than your balance minus the transaction fee

    Parameters

    • requestInfo: RpcRequest

      The request from MQTT

    Returns Promise<void>

recentPendingRequests

  • recentPendingRequests(count?: number, offset?: number): Request[]
  • Retreives pending requests from the send chain

    Parameters

    • Default value count: number = 5

      Number of requests you wish to retrieve

    • Default value offset: number = 0

      Number of requests back from the frontier tip you wish to start at

    Returns Request[]

    all the requests

recentReceiveRequests

  • recentReceiveRequests(count?: number, offset?: number): Request[]
  • Retreives requests from the receive chain

    Parameters

    • Default value count: number = 5

      Number of requests you wish to retrieve

    • Default value offset: number = 0

      Number of requests back from the frontier tip you wish to start at

    Returns Request[]

    all the requests

recentRequests

  • recentRequests(count?: number, offset?: number): Request[]
  • Retreives requests from the send chain

    Parameters

    • Default value count: number = 5

      Number of requests you wish to retrieve

    • Default value offset: number = 0

      Number of requests back from the frontier tip you wish to start at

    Returns Request[]

    all the requests

removePendingRequest

  • removePendingRequest(hash: string): boolean
  • Called when a request is confirmed to remove it from the pending request pool

    Parameters

    • hash: string

      The hash of the request we are confirming

    Returns boolean

    true or false if the pending request was found and removed

removePendingRequests

  • removePendingRequests(): void

Private settingToChange

  • settingToChange(setting: Setting): RpcPrivileges

Private settingToChangeModify

  • settingToChangeModify(setting: Setting): RpcPrivileges

Private settingToModify

  • settingToModify(setting: Setting): RpcSettings

sync

toJSON

updateAccountStatusFromRequest

updateTokenInfoFromRequest

  • updateTokenInfoFromRequest(request: Request): void
  • Updates the token account by comparing the RPC token account info with the changes in a new request Also updates the pending balance based on the new balance and the pending chain

    Parameters

    • request: Request

      request that is being calculated on

    Returns void

validTokenDestination

  • validTokenDestination(address: string): Promise<boolean>
  • Validates if the account is a valid destination to send token funds to

    Parameters

    • address: string

      Address of the controller you are checking

    Returns Promise<boolean>

validateRequest

  • validateRequest(request: Request): Promise<boolean>

verifyChain

  • verifyChain(): boolean

verifyReceiveChain

  • verifyReceiveChain(): boolean

Generated using TypeDoc