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

Member

Member object. Allows member-wide actions. Some calls return a promise, and some return objects

Constructor Summary

Public Constructor
public

constructor(options: object)

Represents a Member

Member Summary

Private Members
private
private
private
private

Method Summary

Public Methods
public

Creates an address for this member, and saves it

public

addAlias(alias: Alias): Promise<void>

Adds an alias to this member

public

addAliases(aliases: Array<Alias>): Promise<void>

Adds aliases to this member

public

Adds a Token member to this member's list of trusted beneficiaries.

public

Gets all of the member's aliases

public

approveKey(key: Key): Promise<void>

Approves a new key for this member

public

approveKeys(keys: Array<Key>): Promise<void>

Approves new keys for this member

public

Cancels a token.

public
this method was deprecated. use forAccessToken instead

Clears the access token id used with this client.

public

Clears the security metadata.

public

Creates a new unendorsed access token.

public

Creates a new access token builder, that must be executed.

public

createBlob(ownerId: string, type: string, name: string, data: Uint8Array | Array<number>): Promise<object>

Uploads a blob to the server.

public

createCustomization(logo: object, colors: object, consentText: string, name: string, appName: string): Promise<string>

Creates a customization.

public

Creates a test bank account in a fake bank

public
this method was deprecated. - use createTestBankAccount

Creates a test bank account in a fake bank

public

createTransferToken(lifetimeAmount: number, currency: string): TransferTokenBuilder

this method was deprecated. - use createTransferTokenBuilder instead Creates a transfer token builder, that when executed, will create a transfer token by performing an API call.
public

Creates a transfer token builder, that when executed, will create a transfer token by performing an API call.

public

deleteAddress(addressId: string): Promise<void>

Deletes a member's address by id

public

Deletes the member.

public

Endorses a token.

public

Gets the member's first alias

public

forAccessToken(accessTokenId: string): *

Creates a representable that acts as another member via an access token.

public

Looks up all access tokens

public

Looks up a member's account by Id

public

Looks up the member's accounts

public

Looks up a existing access token where the calling member is the grantor and given member is the grantee.

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

Gets the info of a bank, including a link for pairing accounts at this bank

public

getBlob(blobId: string): Promise<Blob>

Downloads a blob from the server.

public

Generates a blocking function to cancel a token.

public

Gets the default bank account.

public

Gets a specific notification by Id

public

Gets all notifications for this member

public

Gets a member's public profile.

public

getProfilePicture(id: string, size: stringliteral | stringliteral | stringliteral | stringliteral): Promise<Blob>

Gets a member's public profile picture.

public

Get member's receipt contact.

public

Gets a specific subscriber by Id

public

Gets all subscribers for this member

public

getTestBankNotification(subscriberId: string, notificationId: string): Promise<Notification>

Gets test bank notification.

public

Gets test bank notifications.

public

Looks up a token by its Id

public

getTokenBlob(tokenId: string, blobId: string): Promise<Blob>

Downloads a blob from the server, that is attached to a token.

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

Looks up a transfer

public

Looks up all transfer tokens

public

getTransfers(tokenId: string, offset: string, limit: number): Promise<object>

Looks up all of the member's transfers

public

Get the member's list of trusted beneficiaries.

public

Looks up if this account is default.

public

Gets the member's public keys

public

Links bank accounts to the member

public

Gets the memberId

public

redeemToken(token: Token | string, amount: number, currency: string, description: string, destinations: Array<TransferEndpoint>, refId: string): Promise<Transfer>

Redeems a token.

public

removeAlias(alias: Alias): Promise<void>

Removes an alias from the memberId

public

removeAliases(aliases: Array<Alias>): Promise<void>

Removes aliases from the memberId

public

removeKey(keyId: string): Promise<void>

Removes a key from this member

public

removeKeys(keyIds: Array<string>): Promise<void>

Removes keys from this member

public

Removes a Token member from this member's list of trusted beneficiaries.

public

Cancels the existing token and creates a replacement for it.

public
this method was deprecated. use replaceAccessToken and endorseToken instead Cancels the existing token, creates a replacement and endorses it.
public

Resolves transfer destinations for the given account ID.

public

Sets the customer initiated request flag to true.

public

setDefaultAccount(accountId: string): Promise<void>

Sets the member's default bank account.

public

Replaces the authenticated member's public profile.

public

Uploads the authenticated member's public profile.

public

setReceiptContact(type: stringliteral, value: string): Promise<void>

Replaces member's receipt contact.

public

setSecurityMetadata(securityMetadata: SecurityMetadata): void

Sets the security metadata to be sent with each request.

public

signTokenRequestState(tokenRequestId: string, tokenId: string, state: string): Promise<Signature>

Sign with a Token signature a token request state payload.

public

Stores a request for a token.

public

subscribeToNotifications(handler: string, handlerInstructions: object): Promise<Subscriber>

Creates a subscriber to receive notifications of member events, such as step up auth, new device requests, linking account requests, or transfer notifications

public

triggerBalanceStepUpNotification(accountIds: Array<string>): Promise<NotifyStatusEnum>

Triggers a balance step up notification on the user's app

public

triggerStepUpNotification(tokenId: string): Promise<NotifyStatusEnum>

Triggers a token step up notification on the user's app

public

triggerTransactionStepUpNotification(accountId: string, transactionId: string): Promise<NotifyStatusEnum>

Triggers a transaction step up notification on the user's app

public

unlinkAccounts(accountIds: Array<string>): Promise<void>

Unlinks bank accounts previously linked by the linkAccounts call.

public

Unsubscribes from notifications (removes a subscriber)

public

useAccessToken(accessTokenId: string): void

this method was deprecated. use forAccessToken instead

Sets the access token id to be used with this client.

public

Set the 'normal consumer' rule as member's recovery rule. (As of Nov 2017, this rule was: To recover, verify an alias.)

public

verifyAffiliate(memberId: string): Promise<void>

Verifies and affiliated TPP.

Private Methods
private

_getMember(): *

private
private

_normalizeAlias(alias: Alias, partnerId: string): Promise<Alias>

private

_resolveToken(token: string | Token): Promise<any>

Public Constructors

public constructor(options: object) source

Represents a Member

Params:

NameTypeAttributeDescription
options object

Private Members

private _client: AuthHttpClient source

private _id: string source

private _options: Object source

private _unauthenticatedClient: HttpClient source

Public Methods

public addAddress(name: string, address: Address): Promise<AddressRecord> source

Creates an address for this member, and saves it

Params:

NameTypeAttributeDescription
name string

name of the address (e.g 'Home')

address Address

address

Return:

Promise<AddressRecord>

promise of AddressRecord structure

public addAlias(alias: Alias): Promise<void> source

Adds an alias to this member

Params:

NameTypeAttributeDescription
alias Alias

alias to add

Return:

Promise<void>

empty promise

public addAliases(aliases: Array<Alias>): Promise<void> source

Adds aliases to this member

Params:

NameTypeAttributeDescription
aliases Array<Alias>

aliases to add

Return:

Promise<void>

empty promise

public addTrustedBeneficiary(memberId: string): Promise<void> source

Adds a Token member to this member's list of trusted beneficiaries.

Params:

NameTypeAttributeDescription
memberId string

member ID of the trusted beneficiary to add

Return:

Promise<void>

empty promise

public aliases(): Promise<Array<Alias>> source

Gets all of the member's aliases

Return:

Promise<Array<Alias>>

public approveKey(key: Key): Promise<void> source

Approves a new key for this member

Params:

NameTypeAttributeDescription
key Key

key to add

Return:

Promise<void>

empty promise

public approveKeys(keys: Array<Key>): Promise<void> source

Approves new keys for this member

Params:

NameTypeAttributeDescription
keys Array<Key>

keys to add

Return:

Promise<void>

empty promise

public cancelToken(token: Token | string): Promise<TokenOperationResult> source

Cancels a token. (Called by the payer or the redeemer)

Params:

NameTypeAttributeDescription
token Token | string

token to cancel. Can also be a tokenId

Return:

Promise<TokenOperationResult>

cancelled token

public clearAccessToken(): void source

this method was deprecated. use forAccessToken instead

Clears the access token id used with this client.

Return:

void

public clearSecurityMetadata(): void source

Clears the security metadata.

Return:

void

public createAccessToken(alias: Alias, resources: Array<Resource>): Promise<Token> source

Creates a new unendorsed access token.

Params:

NameTypeAttributeDescription
alias Alias

the alias of the grantee of the Access Token

resources Array<Resource>

a list of resources to give access to

Return:

Promise<Token>

promise of a created Access Token

public createAccessTokenBuilder(): AccessTokenBuilder source

Creates a new access token builder, that must be executed.

Return:

AccessTokenBuilder

promise of a created Access Token

public createBlob(ownerId: string, type: string, name: string, data: Uint8Array | Array<number>): Promise<object> source

Uploads a blob to the server.

Params:

NameTypeAttributeDescription
ownerId string

owner of the blob

type string

MIME type

name string

name of the file

data Uint8Array | Array<number>

data in bytes

Return:

Promise<object>

attachment

public createCustomization(logo: object, colors: object, consentText: string, name: string, appName: string): Promise<string> source

Creates a customization.

Params:

NameTypeAttributeDescription
logo object

logo

colors object
  • nullable: true

map of ARGB colors #AARRGGBB

consentText string

consent text

name string

display name

appName string

corresponding app name

Return:

Promise<string>

customization id

public createTestBankAccount(balance: number, currency: string): Promise<OauthBankAuthorization> source

Creates a test bank account in a fake bank

Params:

NameTypeAttributeDescription
balance number

balance of the account

currency string

currency of the account

Return:

Promise<OauthBankAuthorization>

bank authorization to use with linkAccounts

public createTestBankAccountOauth(balance: number, currency: string): Promise<OauthBankAuthorization> source

this method was deprecated. - use createTestBankAccount

Creates a test bank account in a fake bank

Params:

NameTypeAttributeDescription
balance number

balance of the account

currency string

currency of the account

Return:

Promise<OauthBankAuthorization>

bank authorization to use with linkAccounts

public createTransferToken(lifetimeAmount: number, currency: string): TransferTokenBuilder source

this method was deprecated. - use createTransferTokenBuilder instead Creates a transfer token builder, that when executed, will create a transfer token by performing an API call.

Params:

NameTypeAttributeDescription
lifetimeAmount number

amount limit on the token

currency string

3 letter currency code ('EUR', 'USD', etc)

Return:

TransferTokenBuilder

builder for the token

public createTransferTokenBuilder(lifetimeAmount: number, currency: string): TransferTokenBuilder source

Creates a transfer token builder, that when executed, will create a transfer token by performing an API call.

Params:

NameTypeAttributeDescription
lifetimeAmount number

amount limit on the token

currency string

3 letter currency code ('EUR', 'USD', etc)

Return:

TransferTokenBuilder

builder for the token

public deleteAddress(addressId: string): Promise<void> source

Deletes a member's address by id

Params:

NameTypeAttributeDescription
addressId string

the address id

Return:

Promise<void>

empty promise

public deleteMember(): Promise<void> source

Deletes the member.

Return:

Promise<void>

response to the api call

public endorseToken(token: Token | string): Promise<TokenOperationResult> source

Endorses a token. If this SDK client doesn't have a sufficiently privileged key to endorse the token, this will return MORE_SIGNATURES_NEEDED and the system pushes a notification to the member prompting them to use a higher-privilege key.

Params:

NameTypeAttributeDescription
token Token | string

Transfer token to endorse. Can also be a tokenId

Return:

Promise<TokenOperationResult>

endorsed token

public firstAlias(): Promise<Alias|undefined> source

Gets the member's first alias

Return:

Promise<Alias|undefined>

member's alias

public forAccessToken(accessTokenId: string): * source

Creates a representable that acts as another member via an access token.

Params:

NameTypeAttributeDescription
accessTokenId string

Id of the access token

Return:

*

new member that acts as another member

public getAccessTokens(offset: string, limit: number): Promise<object> source

Looks up all access tokens

Params:

NameTypeAttributeDescription
offset string

where to start looking

limit number

how many to look for

Return:

Promise<object>

access tokens - returns a list of access tokens

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

Looks up a member's account by Id

Params:

NameTypeAttributeDescription
accountId string

accountId

Return:

Promise<Account>

Promise resolving to the account

Throw:

*

error if account not found

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

Looks up the member's accounts

Return:

Promise<Array<Account>>

Promise resolving to the accounts

public getActiveAccessToken(toMemberId: string): Promise<Token> source

Looks up a existing access token where the calling member is the grantor and given member is the grantee.

Params:

NameTypeAttributeDescription
toMemberId string

beneficiary of the active access token

Return:

Promise<Token>

access token returned by the server

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 getBankInfo(bankId: string): Promise<BankInfo> source

Gets the info of a bank, including a link for pairing accounts at this bank

Params:

NameTypeAttributeDescription
bankId string

id of the bank

Return:

Promise<BankInfo>

info

Throw:

*

error if bank not found

public getBlob(blobId: string): Promise<Blob> source

Downloads a blob from the server.

Params:

NameTypeAttributeDescription
blobId string

id of the blob

Return:

Promise<Blob>

downloaded blob

Throw:

*

error if blob not found

public getBlockingCancelTokenFunction(token: Token | string): Promise<function|undefined> source

Generates a blocking function to cancel a token. (Called by the payer or the redeemer)

Params:

NameTypeAttributeDescription
token Token | string

token to cancel. Can also be a tokenId

Return:

Promise<function|undefined>

blocking function to cancel the token

public getDefaultAccount(): Promise<Account> source

Gets the default bank account.

Return:

Promise<Account>

the default bank account

Throw:

*

error if default account not found

public getNotification(notificationId: string): Promise<Notification> source

Gets a specific notification by Id

Params:

NameTypeAttributeDescription
notificationId string

id of the notification

Return:

Promise<Notification>

notification

Throw:

*

error if notification not found

public getNotifications(offset: string, limit: number): Promise<object> source

Gets all notifications for this member

Params:

NameTypeAttributeDescription
offset string

where to start looking

limit number

how many to look for

Return:

Promise<object>

notifications

public getProfile(id: string): Promise<Profile> source

Gets a member's public profile.

Params:

NameTypeAttributeDescription
id string

member id whose profile to get

Return:

Promise<Profile>

profile

Throw:

*

error if profile not found

public getProfilePicture(id: string, size: stringliteral | stringliteral | stringliteral | stringliteral): Promise<Blob> source

Gets a member's public profile picture.

Params:

NameTypeAttributeDescription
id string

member id whose picture to get

size stringliteral | stringliteral | stringliteral | stringliteral

desired size category SMALL/MEDIUM/LARGE/ORIGINAL

Return:

Promise<Blob>

downloaded blob

Throw:

*

error if profile picture not found

public getReceiptContact(): Promise<ReceiptContact> source

Get member's receipt contact.

Return:

Promise<ReceiptContact>

receipt contact: value + type

Throw:

*

error if receipt contact not found

public getSubscriber(subscriberId: string): Promise<Subscriber> source

Gets a specific subscriber by Id

Params:

NameTypeAttributeDescription
subscriberId string

id of the subscriber

Return:

Promise<Subscriber>

subscriber

Throw:

*

error if subscriber not found

public getSubscribers(): Promise<Array<Subscriber>> source

Gets all subscribers for this member

Return:

Promise<Array<Subscriber>>

subscribers

public getTestBankNotification(subscriberId: string, notificationId: string): Promise<Notification> source

Gets test bank notification.

Params:

NameTypeAttributeDescription
subscriberId string

id of subscriber

notificationId string

id of notification

Return:

Promise<Notification>

response to the API call

public getTestBankNotifications(subscriberId: string): Promise<Array<Notification>> source

Gets test bank notifications.

Params:

NameTypeAttributeDescription
subscriberId string

id of subscriber

Return:

Promise<Array<Notification>>

response to the API call

public getToken(tokenId: string): Promise<Token> source

Looks up a token by its Id

Params:

NameTypeAttributeDescription
tokenId string

id of the token

Return:

Promise<Token>

token

Throw:

*

error if token not found

public getTokenBlob(tokenId: string, blobId: string): Promise<Blob> source

Downloads a blob from the server, that is attached to a token.

Params:

NameTypeAttributeDescription
tokenId string

id of the token

blobId string

id of the blob

Return:

Promise<Blob>

downloaded blob

Throw:

*

error if token blob not found

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

public getTransfer(transferId: string): Promise<Transfer> source

Looks up a transfer

Params:

NameTypeAttributeDescription
transferId string

id to look up

Return:

Promise<Transfer>

transfer if found

Throw:

*

error if transfer not found

public getTransferTokens(offset: string, limit: number): Promise<object> source

Looks up all transfer tokens

Params:

NameTypeAttributeDescription
offset string

where to start looking

limit number

how many to look for

Return:

Promise<object>

returns a list of Transfer Tokens

public getTransfers(tokenId: string, offset: string, limit: number): Promise<object> source

Looks up all of the member's transfers

Params:

NameTypeAttributeDescription
tokenId string

token to use for lookup

offset string

where to start looking

limit number

how many to retrieve

Return:

Promise<object>

Transfers

public getTrustedBeneficiaries(): Promise<Array<TrustedBeneficiary>> source

Get the member's list of trusted beneficiaries.

Return:

Promise<Array<TrustedBeneficiary>>

trusted beneficiaries - list of TrustedBeneficiary objects

public isDefaultAccount(accountId: string): Promise<boolean> source

Looks up if this account is default.

Params:

NameTypeAttributeDescription
accountId string

the bank account id

Return:

Promise<boolean>

true if the account is default; false otherwise

public keys(): Promise<Array<Key>> source

Gets the member's public keys

Return:

Promise<Array<Key>>

keys objects

public linkAccounts(authorization: OauthBankAuthorization | any): Promise<Array<Account>> source

Links bank accounts to the member

Params:

NameTypeAttributeDescription
authorization OauthBankAuthorization | any

bankAuthorization obtained from bank, or oauthBankAuthorization

Return:

Promise<Array<Account>>

Promise resolving the the Accounts linked

public memberId(): string source

Gets the memberId

Return:

string

public redeemToken(token: Token | string, amount: number, currency: string, description: string, destinations: Array<TransferEndpoint>, refId: string): Promise<Transfer> source

Redeems a token. (Called by the payee or redeemer)

Params:

NameTypeAttributeDescription
token Token | string

token to redeem. Can also be a tokenId

amount number
  • nullable: true

amount to redeemer

currency string
  • nullable: true

currency to redeem

description string
  • nullable: true

optional transfer description

destinations Array<TransferEndpoint>
  • optional
  • default: undefined

transfer destinations

refId string

Id that will be set on created Transfer. Token uses this to detect duplicates. Caller might use this to recognize the transfer. If param empty, transfer will have random refId.

Return:

Promise<Transfer>

Transfer created as a result of this redeem call

public removeAlias(alias: Alias): Promise<void> source

Removes an alias from the memberId

Params:

NameTypeAttributeDescription
alias Alias

alias to remove

Return:

Promise<void>

empty promise

public removeAliases(aliases: Array<Alias>): Promise<void> source

Removes aliases from the memberId

Params:

NameTypeAttributeDescription
aliases Array<Alias>

aliases to remove

Return:

Promise<void>

empty promise

public removeKey(keyId: string): Promise<void> source

Removes a key from this member

Params:

NameTypeAttributeDescription
keyId string

keyId to remove. Note, keyId is the hash of the pk

Return:

Promise<void>

empty promise

public removeKeys(keyIds: Array<string>): Promise<void> source

Removes keys from this member

Params:

NameTypeAttributeDescription
keyIds Array<string>

keyIds to remove. Note, keyId is the hash of the pk

Return:

Promise<void>

empty promise

public removeTrustedBeneficiary(memberId: string): Promise<void> source

Removes a Token member from this member's list of trusted beneficiaries.

Params:

NameTypeAttributeDescription
memberId string

member ID of the trusted beneficiary to remove

Return:

Promise<void>

empty promise

public replaceAccessToken(tokenToCancel: Token | string, newResources: Array<Resource>): Promise<TokenOperationResult> source

Cancels the existing token and creates a replacement for it.

Params:

NameTypeAttributeDescription
tokenToCancel Token | string

the old token to cancel

newResources Array<Resource>

the new resources for this token to grant access to

Return:

Promise<TokenOperationResult>

the result of the operation

public replaceAndEndorseAccessToken(tokenToCancel: Token | string, newResources: Array<Resource>): Promise<TokenOperationResult> source

this method was deprecated. use replaceAccessToken and endorseToken instead Cancels the existing token, creates a replacement and endorses it.

Params:

NameTypeAttributeDescription
tokenToCancel Token | string

the old token to cancel

newResources Array<Resource>

the new resources for this token to grant access to

Return:

Promise<TokenOperationResult>

the result of the operation

public resolveTransferDestinations(accountId: string): Promise<TransferEndpoint[]> source

Resolves transfer destinations for the given account ID.

Params:

NameTypeAttributeDescription
accountId string

id of account to resolve destinations for

Return:

Promise<TransferEndpoint[]>

resolved transfer endpoints

public setCustomerInitiated(): void source

Sets the customer initiated request flag to true.

Return:

void

public setDefaultAccount(accountId: string): Promise<void> source

Sets the member's default bank account.

Params:

NameTypeAttributeDescription
accountId string

the bank account id

Return:

Promise<void>

empty promise

public setProfile(profile: Profile): Promise<Profile> source

Replaces the authenticated member's public profile.

Params:

NameTypeAttributeDescription
profile Profile

profile to set

Return:

Promise<Profile>

newly-set profile

public setProfilePicture(type: string, data: Uint8Array | Array<number>): Promise<void> source

Uploads the authenticated member's public profile.

Params:

NameTypeAttributeDescription
type string

MIME type

data Uint8Array | Array<number>

data in bytes

Return:

Promise<void>

empty promise

public setReceiptContact(type: stringliteral, value: string): Promise<void> source

Replaces member's receipt contact.

Params:

NameTypeAttributeDescription
type stringliteral
  • optional
  • default: EMAIL

receipt contact type, can only be EMAIL currently

value string

receipt contact value for corresponding type

Return:

Promise<void>

empty promise

public setSecurityMetadata(securityMetadata: SecurityMetadata): void source

Sets the security metadata to be sent with each request.

Params:

NameTypeAttributeDescription
securityMetadata SecurityMetadata

securityMetadata

Return:

void

public signTokenRequestState(tokenRequestId: string, tokenId: string, state: string): Promise<Signature> source

Sign with a Token signature a token request state payload.

Params:

NameTypeAttributeDescription
tokenRequestId string

token request id

tokenId string

token id

state string

url state

Return:

Promise<Signature>

response to the api call

public storeTokenRequest(tokenRequest: TokenRequest): Promise<TokenRequest> source

Stores a request for a token. Called by a merchant or a TPP that wants access from a user.

Params:

NameTypeAttributeDescription
tokenRequest TokenRequest

token request to store

Return:

Promise<TokenRequest>

the stored TokenRequest

public subscribeToNotifications(handler: string, handlerInstructions: object): Promise<Subscriber> source

Creates a subscriber to receive notifications of member events, such as step up auth, new device requests, linking account requests, or transfer notifications

Params:

NameTypeAttributeDescription
handler string
  • optional
  • default: token

who is handling the notifications

handlerInstructions object
  • optional
  • default: {}

map of strings with delivery options

Return:

Promise<Subscriber>

Subscriber

public triggerBalanceStepUpNotification(accountIds: Array<string>): Promise<NotifyStatusEnum> source

Triggers a balance step up notification on the user's app

Params:

NameTypeAttributeDescription
accountIds Array<string>

array of account ids

Return:

Promise<NotifyStatusEnum>

notification status

public triggerStepUpNotification(tokenId: string): Promise<NotifyStatusEnum> source

Triggers a token step up notification on the user's app

Params:

NameTypeAttributeDescription
tokenId string

token ID

Return:

Promise<NotifyStatusEnum>

notification status

public triggerTransactionStepUpNotification(accountId: string, transactionId: string): Promise<NotifyStatusEnum> source

Triggers a transaction step up notification on the user's app

Params:

NameTypeAttributeDescription
accountId string

account id

transactionId string

transaction id

Return:

Promise<NotifyStatusEnum>

notification status

public unlinkAccounts(accountIds: Array<string>): Promise<void> source

Unlinks bank accounts previously linked by the linkAccounts call.

Params:

NameTypeAttributeDescription
accountIds Array<string>

account ids to unlink

Return:

Promise<void>

empty promise

public unsubscribeFromNotifications(subscriberId: string): Promise<void> source

Unsubscribes from notifications (removes a subscriber)

Params:

NameTypeAttributeDescription
subscriberId string

subscriber to remove

Return:

Promise<void>

empty promise

public useAccessToken(accessTokenId: string): void source

this method was deprecated. use forAccessToken instead

Sets the access token id to be used with this client.

Params:

NameTypeAttributeDescription
accessTokenId string

the access token id

Return:

void

public useDefaultRecoveryRule(): Promise<RecoveryRule> source

Set the 'normal consumer' rule as member's recovery rule. (As of Nov 2017, this rule was: To recover, verify an alias.)

Return:

Promise<RecoveryRule>

promise containing RecoveryRule proto buffer.

public verifyAffiliate(memberId: string): Promise<void> source

Verifies and affiliated TPP.

Params:

NameTypeAttributeDescription
memberId string

id of the member to verify

Return:

Promise<void>

empty promise

Private Methods

private _getMember(): * source

Return:

*

private _getPreviousHash(): * source

Return:

*

private _normalizeAlias(alias: Alias, partnerId: string): Promise<Alias> source

Params:

NameTypeAttributeDescription
alias Alias
partnerId string

Return:

Promise<Alias>

private _resolveToken(token: string | Token): Promise<any> source

Params:

NameTypeAttributeDescription
token string | Token

Return:

Promise<any>