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

HttpClient

Client for making unauthenticated requests to the Token gateway.

Constructor Summary

Public Constructor
public

constructor(undefined: *)

Member Summary

Private Members
private

Method Summary

Public Methods
public

async approveFirstKey(memberId: string, key: Object, cryptoEngine: Object): Object

Approve a first key for a member (self signed).

public

async approveFirstKeys(memberId: string, keys: Array, cryptoEngine: Object): Object

Approve the first keys for a member (self signed).

public

async createMemberId(memberType: *, tokenRequestId: *): Object

Creates a memberId.

public

async getBanksOrCountries(options: Object, getCountries: boolean): Object

Gets banks or countries.

public

async getMember(memberId: string): Object

Gets the member's information.

public

Returns the Token member.

public

async normalizeAlias(alias: *): *

public

async resolveAlias(alias: Object): Object

Gets a member given an alias.

Public Constructors

public constructor(undefined: *) source

Params:

NameTypeAttributeDescription
undefined *

Private Members

private _instance: * source

Public Methods

public async approveFirstKey(memberId: string, key: Object, cryptoEngine: Object): Object source

Approve a first key for a member (self signed).

Params:

NameTypeAttributeDescription
memberId string

ID of the member

key Object

key to approve

cryptoEngine Object

engine to use for signing

Return:

Object

response to the API call

public async approveFirstKeys(memberId: string, keys: Array, cryptoEngine: Object): Object source

Approve the first keys for a member (self signed).

Params:

NameTypeAttributeDescription
memberId string

ID of the member

keys Array

keys to approve

cryptoEngine Object

engine to use for signing

Return:

Object

response to the API call

public async createMemberId(memberType: *, tokenRequestId: *): Object source

Creates a memberId.

Params:

NameTypeAttributeDescription
memberType *

{string} memberType - type of member to create. 'PERSONAL' if undefined

tokenRequestId *

{string} tokenRequestId - (optional) token request ID if the member is being claimed

Return:

Object

response to the API call

public async getBanksOrCountries(options: Object, getCountries: boolean): Object source

Gets banks or countries.

Params:

NameTypeAttributeDescription
options Object

optional parameters

getCountries boolean

get countries instead of banks if true

Return:

Object

response to the API call

public async getMember(memberId: string): Object source

Gets the member's information.

Params:

NameTypeAttributeDescription
memberId string

member ID to lookup the member for

Return:

Object

response to the API call

public async getTokenMember(): Promise source

Returns the Token member.

Return:

Promise

response to the API call

public async normalizeAlias(alias: *): * source

Params:

NameTypeAttributeDescription
alias *

Return:

*

public async resolveAlias(alias: Object): Object source

Gets a member given an alias.

Params:

NameTypeAttributeDescription
alias Object

alias to lookup

Return:

Object

response to the API call