Home Reference Source Test
public class | source

Member

Extends:

@token-io/core~CoreMember → Member

Represents a Token member.

Constructor Summary

Public Constructor
public

constructor(options: object)

Member Summary

Private Members
private

_client: *

private

Method Summary

Public Methods
public

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

Cancels a token.

public

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

Creates a customization.

public

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

public

Looks up all access tokens.

public

getAccount(accountId: string): Promise<Account>

Looks up a member's account by ID.

public

getAccounts(): Promise<Array<Account>>

Looks up the member's accounts.

public

getBlob(blobId: string): Promise<Blob>

Downloads a blob from the server.

public

getBulkTransfer(bulkTransferId: string): Promise<BulkTransfer>

Looks up an existing bulk transfer.

public

getProfile(id: string): Promise<Profile>

Gets a member's public profile.

public

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

Gets a member's public profile picture.

public

getStandingOrderSubmission(submissionId: string): Promise<StandingOrderSubmission>

Looks up an existing Token standing order submission.

public

Looks up existing Token standing order submissions.

public

getToken(tokenId: string): Promise<Token>

Looks up a token by its ID.

public

getTransfer(transferId: string): Promise<Transfer>

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

redeemBulkTransferToken(tokenId: string): Promise<BulkTransfer>

Redeems a bulk transfer token.

public

redeemStandingOrderToken(tokenId: string): Promise<StandingOrderSubmission>

Redeems a standing order token.

public

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

Redeems a token.

public

setProfile(profile: Profile): Promise<Profile>

Replaces the authenticated member's public profile.

public

Uploads the authenticated member's public profile.

public

storeTokenRequest(tokenRequest: TokenRequestBuilder): Promise<TokenRequest>

Stores a request for a token.

public

verifyEidas(payload: VerifyEidasPayload, signature: string): Promise<VerifyEidasResponse>

Verifies eIDAS alias with an eIDAS certificate, containing auth number equal to the value of the alias.

Private Methods
private

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

Public Constructors

public constructor(options: object) source

Params:

NameTypeAttributeDescription
options object

Private Members

private _client: * source

private _unauthenticatedClient: * source

Public Methods

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

Cancels a token.

Params:

NameTypeAttributeDescription
token Token | string

token to cancel, can be tokenId

Return:

Promise<TokenOperationResult>

cancelled token

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

Creates a customization.

Params:

NameTypeAttributeDescription
logo BlobPayload

logo

colors object
  • nullable: true

map of ARGB colors #AARRGGBB

consentText string
  • nullable: true

consent text

name string
  • nullable: true

display name

appName string
  • nullable: true

corresponding app name

Return:

Promise<string>

customization ID

public forAccessToken(accessTokenId: string): Representable source

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

Params:

NameTypeAttributeDescription
accessTokenId string

ID of the access token

Return:

Representable

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

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

Looks up the member's accounts.

Return:

Promise<Array<Account>>

Promise resolving to the accounts

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

public getBulkTransfer(bulkTransferId: string): Promise<BulkTransfer> source

Looks up an existing bulk transfer.

Params:

NameTypeAttributeDescription
bulkTransferId string

bulkTransferId

Return:

Promise<BulkTransfer>

bulk transfer record

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

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

Gets a member's public profile picture.

Params:

NameTypeAttributeDescription
id string

member ID whose picture to get

size ProfilePictureSize

desired size category SMALL/MEDIUM/LARGE/ORIGINAL

Return:

Promise<Blob>

downloaded blob

public getStandingOrderSubmission(submissionId: string): Promise<StandingOrderSubmission> source

Looks up an existing Token standing order submission.

Params:

NameTypeAttributeDescription
submissionId string

ID of the standing order submission

Return:

Promise<StandingOrderSubmission>

standing order submission

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

Looks up existing Token standing order submissions.

Params:

NameTypeAttributeDescription
offset string

optional where to start looking

limit string

how many to retrieve

Return:

Promise<object>

standing order submissions

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

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

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 redeemBulkTransferToken(tokenId: string): Promise<BulkTransfer> source

Redeems a bulk transfer token.

Params:

NameTypeAttributeDescription
tokenId string

ID of token to redeem

Return:

Promise<BulkTransfer>

bulk transfer record

public redeemStandingOrderToken(tokenId: string): Promise<StandingOrderSubmission> source

Redeems a standing order token.

Params:

NameTypeAttributeDescription
tokenId string

token to redeem. Can also be a tokenId

Return:

Promise<StandingOrderSubmission>

standing order submission created as a result of this redeem call

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

Redeems a token.

Params:

NameTypeAttributeDescription
token Token | string

token to redeem. Can also be a tokenId

amount number

amount to redeem

currency string

currency to redeem

description string

optional transfer description

destinations Array<TransferDestination>
  • 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 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: ArrayBuffer | string): Promise<void> source

Uploads the authenticated member's public profile.

Params:

NameTypeAttributeDescription
type string

MIME type

data ArrayBuffer | string

data in bytes, can be base64 string

Return:

Promise<void>

empty promise

public storeTokenRequest(tokenRequest: TokenRequestBuilder): 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 TokenRequestBuilder

token request to store

Return:

Promise<TokenRequest>

the stored TokenRequestBuilder

public verifyEidas(payload: VerifyEidasPayload, signature: string): Promise<VerifyEidasResponse> source

Verifies eIDAS alias with an eIDAS certificate, containing auth number equal to the value of the alias. Before making this call make sure that:

  • The member is under the realm of a bank (the one tpp tries to gain access to)
  • An eIDAS-type alias with the value equal to auth number of the TPP is added to the member
  • The realmId of the alias is equal to the member's realmId

Params:

NameTypeAttributeDescription
payload VerifyEidasPayload

payload containing the member id and the base64 encoded eIDAS certificate

signature string

the payload signed with a private key corresponding to the certificate

Return:

Promise<VerifyEidasResponse>

a result of the verification process

Private Methods

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

Params:

NameTypeAttributeDescription
token string | Token

Return:

Promise<Token>