Home Reference Source Test
import Representable from '@token-io/tpp/src/main/Representable.js'
public class | source

Representable

Represents the part of a Token member that can be accessed through an access token.

Constructor Summary

Public Constructor
public

constructor(member: Member)

User Member::forAccessToken.

Member Summary

Private Members
private

Method Summary

Public Methods
public

confirmFunds(accountId: string, amount: number | string, currency: string): Promise<boolean>

Confirms if an account has sufficient funds for a purchase.

public

getAccount(accountId: string): Promise<Account>

Looks up an account by the account ID.

public

getAccounts(): Promise<Array<Account>>

Looks up linked accounts.

public

getBalance(accountId: string, keyLevel: KeyLevel): Promise<Balance>

Looks up the balance of an account.

public

getBalances(accountIds: Array<string>, keyLevel: KeyLevel): Promise<Array<Balance>>

Looks up the balances of an array of accounts.

public

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

Looks up an existing standing order for a given account.

public

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

Looks up standing orders for a given account.

public

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

Looks up an existing transaction for a given account.

public

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

Looks up transactions for a given account.

public

resolveTransferDestinations(accountId: string): Promise<TransferDestination>

Resolves transfer destinations for the given account ID.

Public Constructors

public constructor(member: Member) source

User Member::forAccessToken.

Params:

NameTypeAttributeDescription
member Member

Private Members

private _member: Member source

Public Methods

public confirmFunds(accountId: string, amount: number | string, currency: string): Promise<boolean> source

Confirms if an account has sufficient funds for a purchase.

Params:

NameTypeAttributeDescription
accountId string

accountId

amount number | string

amount

currency string

currency

Return:

Promise<boolean>

true if account has sufficient funds

public getAccount(accountId: string): Promise<Account> source

Looks up an account by the account ID.

Params:

NameTypeAttributeDescription
accountId string

the ID

Return:

Promise<Account>

Promise resolving to the account

public getAccounts(): Promise<Array<Account>> source

Looks up linked accounts.

Return:

Promise<Array<Account>>

Promise resolving to the accounts

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

Looks up the balance of an account.

Params:

NameTypeAttributeDescription
accountId string

ID of the account

keyLevel KeyLevel

key level

Return:

Promise<Balance>

Promise of get balance response object

public getBalances(accountIds: Array<string>, keyLevel: KeyLevel): Promise<Array<Balance>> source

Looks up the balances of an array of accounts.

Params:

NameTypeAttributeDescription
accountIds Array<string>

array of account IDs

keyLevel KeyLevel

key level

Return:

Promise<Array<Balance>>

Promise of get balances response object

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

Looks up an existing standing order for a given account.

Params:

NameTypeAttributeDescription
accountId string

accountId

standingOrderId string

standingOrderId

keyLevel KeyLevel

keyLevel

Return:

Promise<StandingOrder>

standing order

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

Looks up standing orders for a given account.

Params:

NameTypeAttributeDescription
accountId string

accountId

offset string

offset

limit number

limit

keyLevel KeyLevel

keyLevel

Return:

Promise<object>

standing orders

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

Looks up an existing transaction for a given account.

Params:

NameTypeAttributeDescription
accountId string

ID of the account

transactionId string

which transaction to look up

keyLevel KeyLevel

key level

Return:

Promise<Transaction>

Transaction

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

Looks up transactions for a given account.

Params:

NameTypeAttributeDescription
accountId string

ID of the account

offset string

where to start looking

limit number

how many to retrieve

keyLevel KeyLevel

key level

Return:

Promise<object>

Transactions

public resolveTransferDestinations(accountId: string): Promise<TransferDestination> source

Resolves transfer destinations for the given account ID.

Params:

NameTypeAttributeDescription
accountId string

ID of account to resolve destinations for

Return:

Promise<TransferDestination>

resolved transfer destinations