Home Reference Source Test
import Representable from 'token-io/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)

Instantiate a representable that acts on behalf of a Token member.

Member Summary

Private Members
private

Method Summary

Public Methods
public

Looks up an account by the account dd

public

Looks up linked accounts.

public

Gets the member's address

public

Gets the member's addresses

public

getBalance(accountId: string, keyLevel: string): Promise<object>

Looks up the balance of an account

public

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

Looks up the balances of an array of accounts

public

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

Looks up a transaction

public

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

Looks up all of the member's transactions for an account

Public Constructors

public constructor(member: Member) source

Instantiate a representable that acts on behalf of a Token member.

Params:

NameTypeAttributeDescription
member Member

the Token member

Private Members

private _member: Member source

Public Methods

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

Looks up an account by the account dd

Params:

NameTypeAttributeDescription
accountId string

the id

Return:

Promise<Account>

Promise resolving to the account

Throw:

*

error if account not found

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

Looks up linked accounts.

Return:

Promise<Array<Account>>

Promise resolving to the accounts

public getAddress(addressId: string): Promise<AddressRecord> source

Gets the member's address

Params:

NameTypeAttributeDescription
addressId string

the address id

Return:

Promise<AddressRecord>

AddressRecord structure

Throw:

*

error if address not found

public getAddresses(): Promise<Array<AddressRecord>> source

Gets the member's addresses

Return:

Promise<Array<AddressRecord>>

list of AddressRecord structures

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

Looks up the balance of an account

Params:

NameTypeAttributeDescription
accountId string

id of the account

keyLevel string

key level

Return:

Promise<object>

Promise of get balance response object

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

Looks up the balances of an array of accounts

Params:

NameTypeAttributeDescription
accountIds Array<string>

array of account ids

keyLevel string

key level

Return:

Promise<Array<object>>

Promise of get balances response object

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

Looks up a transaction

Params:

NameTypeAttributeDescription
accountId string

id of the account

transactionId string

which transaction to look up

keyLevel string

key level

Return:

Promise<Transaction>

the Transaction

Throw:

*

error if transaction not found

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

Looks up all of the member's transactions for an account

Params:

NameTypeAttributeDescription
accountId string

id of the account

offset string

where to start looking

limit number

how many to retrieve

keyLevel string

key level

Return:

Promise<object>

Transactions