Home Reference Source
import {Account} from '@token-io/core/src/main/Account.js'
public class | source

Account

Represents a bank account.

Constructor Summary

Public Constructor
public

constructor(account: Object, member: Member)

Use Member::getAccount(s).

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

Gets the account's bank.

public

getBalance(keyLevel: KeyLevel): Promise<Balance>

Looks up the account's balance.

public

getStandingOrder(standingOrderId: string, keyLevel: KeyLevel): Promise<StandingOrder>

Looks up an existing standing account order for a given account.

public

getStandingOrders(accountId: *, offset: *, limit: *, keyLevel: *): *

Looks up all of the member's standing orders on the account

public

getTransaction(transactionId: string, keyLevel: KeyLevel): Promise<Transaction>

Looks up a transaction by ID.

public

getTransactions(offset: string, limit: number, keyLevel: KeyLevel): Promise<object>

Looks up the account's transactions.

public

id(): string

Gets the account ID.

public

Looks up if this account is locked.

public

Gets the account owner.

public

Gets the account name.

public

Looks up if this account requires external authorization for creating transfers.

public

Looks up if this account supports retrieval of information such as balance.

public

Looks up if this account supports receiving payment.

public

Looks up if this account supports sending payment.

public

Fetches the raw account object.

Public Constructors

public constructor(account: Object, member: Member) source

Use Member::getAccount(s).

Params:

NameTypeAttributeDescription
account Object
member Member

Public Members

public account: Object source

public accountMember: Object source

Public Methods

public bankId(): string source

Gets the account's bank.

Return:

string

the account's bank

public getBalance(keyLevel: KeyLevel): Promise<Balance> source

Looks up the account's balance.

Params:

NameTypeAttributeDescription
keyLevel KeyLevel

keyLevel

Return:

Promise<Balance>

the account's balance

public getStandingOrder(standingOrderId: string, keyLevel: KeyLevel): Promise<StandingOrder> source

Looks up an existing standing account order for a given account.

Params:

NameTypeAttributeDescription
standingOrderId string

standingOrderId

keyLevel KeyLevel

keyLevel

Return:

Promise<StandingOrder>

standing order record

public getStandingOrders(accountId: *, offset: *, limit: *, keyLevel: *): * source

Looks up all of the member's standing orders on the account

Params:

NameTypeAttributeDescription
accountId *
offset *
limit *
keyLevel *

Return:

*

standing orders

public getTransaction(transactionId: string, keyLevel: KeyLevel): Promise<Transaction> source

Looks up a transaction by ID.

Params:

NameTypeAttributeDescription
transactionId string

transactionId

keyLevel KeyLevel

keyLevel

Return:

Promise<Transaction>

transaction

public getTransactions(offset: string, limit: number, keyLevel: KeyLevel): Promise<object> source

Looks up the account's transactions.

Params:

NameTypeAttributeDescription
offset string

where to start

limit number

max number to retrieve

keyLevel KeyLevel

keyLevel

Return:

Promise<object>

transactions

public id(): string source

Gets the account ID.

Return:

string

the account ID

public isLocked(): boolean source

Looks up if this account is locked.

Return:

boolean

whether this account is locked

public member(): Member source

Gets the account owner.

Return:

Member

member that owns the account

public name(): string source

Gets the account name.

Return:

string

name of the account

public requiresExternalAuth(): boolean source

Looks up if this account requires external authorization for creating transfers.

Return:

boolean

whether this account requires external auth

public supportsInformation(): boolean source

Looks up if this account supports retrieval of information such as balance.

Return:

boolean

whether this account supports info

public supportsReceivePayment(): boolean source

Looks up if this account supports receiving payment.

Return:

boolean

whether this account supports receiving payment

public supportsSendPayment(): boolean source

Looks up if this account supports sending payment.

Return:

boolean

whether this account supports sending payment

public toProto(): Object source

Fetches the raw account object.

Return:

Object

the account object