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 |
addAddress(name: string, address: Address): Promise<AddressRecord> Creates an address for this member, and saves it |
|
public |
Adds an alias to this member |
|
public |
addAliases(aliases: Array<Alias>): Promise<void> Adds aliases to this member |
|
public |
addTrustedBeneficiary(memberId: string): Promise<void> 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 |
cancelToken(token: Token | string): Promise<TokenOperationResult> Cancels a token. |
|
public |
clearAccessToken(): void this method was deprecated. use forAccessToken instead
Clears the access token id used with this client. |
|
public |
clearSecurityMetadata(): void 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 |
createTestBankAccount(balance: number, currency: string): Promise<OauthBankAuthorization> Creates a test bank account in a fake bank |
|
public |
createTestBankAccountOauth(balance: number, currency: string): Promise<OauthBankAuthorization> 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 |
createTransferTokenBuilder(lifetimeAmount: number, currency: string): TransferTokenBuilder 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 |
deleteMember(): Promise<void> Deletes the member. |
|
public |
endorseToken(token: Token | string): Promise<TokenOperationResult> 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 |
getAccessTokens(offset: string, limit: number): Promise<object> 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 |
getActiveAccessToken(toMemberId: string): Promise<Token> Looks up a existing access token where the calling member is the grantor and given member is the grantee. |
|
public |
getAddress(addressId: string): Promise<AddressRecord> 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 |
Looks up the balances of an array of accounts |
|
public |
getBankInfo(bankId: string): Promise<BankInfo> Gets the info of a bank, including a link for pairing accounts at this bank |
|
public |
Downloads a blob from the server. |
|
public |
Generates a blocking function to cancel a token. |
|
public |
Gets the default bank account. |
|
public |
getNotification(notificationId: string): Promise<Notification> Gets a specific notification by Id |
|
public |
getNotifications(offset: string, limit: number): Promise<object> Gets all notifications for this member |
|
public |
getProfile(id: string): Promise<Profile> 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 |
getSubscriber(subscriberId: string): Promise<Subscriber> 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 |
getTestBankNotifications(subscriberId: string): Promise<Array<Notification>> 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 |
getTransfer(transferId: string): Promise<Transfer> Looks up a transfer |
|
public |
getTransferTokens(offset: string, limit: number): Promise<object> Looks up all transfer tokens |
|
public |
Looks up all of the member's transfers |
|
public |
Get the member's list of trusted beneficiaries. |
|
public |
isDefaultAccount(accountId: string): Promise<boolean> Looks up if this account is default. |
|
public |
Gets the member's public keys |
|
public |
linkAccounts(authorization: OauthBankAuthorization | any): Promise<Array<Account>> 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 |
Removes a key from this member |
|
public |
removeKeys(keyIds: Array<string>): Promise<void> Removes keys from this member |
|
public |
removeTrustedBeneficiary(memberId: string): Promise<void> Removes a Token member from this member's list of trusted beneficiaries. |
|
public |
replaceAccessToken(tokenToCancel: Token | string, newResources: Array<Resource>): Promise<TokenOperationResult> Cancels the existing token and creates a replacement for it. |
|
public |
replaceAndEndorseAccessToken(tokenToCancel: Token | string, newResources: Array<Resource>): Promise<TokenOperationResult> this method was deprecated. use replaceAccessToken and endorseToken instead
Cancels the existing token, creates a replacement and endorses it.
|
|
public |
resolveTransferDestinations(accountId: string): Promise<TransferEndpoint[]> Resolves transfer destinations for the given account ID. |
|
public |
setCustomerInitiated(): void Sets the customer initiated request flag to true. |
|
public |
setDefaultAccount(accountId: string): Promise<void> Sets the member's default bank account. |
|
public |
setProfile(profile: Profile): Promise<Profile> Replaces the authenticated member's public profile. |
|
public |
setProfilePicture(type: string, data: Uint8Array | Array<number>): Promise<void> 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 |
Sign with a Token signature a token request state payload. |
|
public |
storeTokenRequest(tokenRequest: TokenRequest): Promise<TokenRequest> 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 |
unsubscribeFromNotifications(subscriberId: string): Promise<void> 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 |
_getPreviousHash(): * |
|
private |
_normalizeAlias(alias: Alias, partnerId: string): Promise<Alias> |
|
private |
_resolveToken(token: string | Token): Promise<any> |
Public Constructors
Private Members
private _client: AuthHttpClient 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
public addAlias(alias: Alias): Promise<void> source
Adds an alias to this member
Params:
Name | Type | Attribute | Description |
alias | Alias | alias to add |
public addTrustedBeneficiary(memberId: string): Promise<void> source
Adds a Token member to this member's list of trusted beneficiaries.
Params:
Name | Type | Attribute | Description |
memberId | string | member ID of the trusted beneficiary to add |
public approveKey(key: Key): Promise<void> source
Approves a new key for this member
Params:
Name | Type | Attribute | Description |
key | Key | key to add |
public cancelToken(token: Token | string): Promise<TokenOperationResult> source
Cancels a token. (Called by the payer or the redeemer)
public clearAccessToken(): void source
Clears the access token id used with this client.
Return:
void |
public createAccessToken(alias: Alias, resources: Array<Resource>): Promise<Token> source
Creates a new unendorsed access token.
public createAccessTokenBuilder(): AccessTokenBuilder source
Creates a new access token builder, that must be executed.
public createBlob(ownerId: string, type: string, name: string, data: Uint8Array | Array<number>): Promise<object> source
Uploads a blob to the server.
public createCustomization(logo: object, colors: object, consentText: string, name: string, appName: string): Promise<string> source
Creates a customization.
public createTestBankAccount(balance: number, currency: string): Promise<OauthBankAuthorization> source
Creates a test bank account in a fake bank
public createTestBankAccountOauth(balance: number, currency: string): Promise<OauthBankAuthorization> source
Creates a test bank account in a fake bank
public createTransferToken(lifetimeAmount: number, currency: string): TransferTokenBuilder source
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.
public deleteAddress(addressId: string): Promise<void> source
Deletes a member's address by id
Params:
Name | Type | Attribute | Description |
addressId | string | the address id |
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.
public forAccessToken(accessTokenId: string): * source
Creates a representable that acts as another member via an access token.
Params:
Name | Type | Attribute | Description |
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
public getAccount(accountId: string): Promise<Account> source
Looks up a member's account by Id
Params:
Name | Type | Attribute | Description |
accountId | string | accountId |
Throw:
* |
error if account not found |
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:
Name | Type | Attribute | Description |
toMemberId | string | beneficiary of the active access token |
public getAddress(addressId: string): Promise<AddressRecord> source
Gets the member's address
Params:
Name | Type | Attribute | Description |
addressId | string | the address id |
Throw:
* |
error if address not found |
public getBalance(accountId: string, keyLevel: string): Promise<object> source
Looks up the balance of an account
public getBalances(accountIds: Array<string>, keyLevel: string): Promise<Array<object>> source
Looks up the balances of an array of accounts
public getBankInfo(bankId: string): Promise<BankInfo> source
Gets the info of a bank, including a link for pairing accounts at this bank
Params:
Name | Type | Attribute | Description |
bankId | string | id of the bank |
Throw:
* |
error if bank not found |
public getBlob(blobId: string): Promise<Blob> source
Downloads a blob from the server.
Params:
Name | Type | Attribute | Description |
blobId | string | id of the 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)
public getDefaultAccount(): Promise<Account> source
Gets 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:
Name | Type | Attribute | Description |
notificationId | string | id of the notification |
Throw:
* |
error if notification not found |
public getNotifications(offset: string, limit: number): Promise<object> source
Gets all notifications for this member
public getProfile(id: string): Promise<Profile> source
Gets a member's public profile.
Params:
Name | Type | Attribute | Description |
id | string | member id whose profile to get |
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:
Name | Type | Attribute | Description |
id | string | member id whose picture to get |
|
size | stringliteral | stringliteral | stringliteral | stringliteral | desired size category SMALL/MEDIUM/LARGE/ORIGINAL |
Throw:
* |
error if profile picture not found |
public getReceiptContact(): Promise<ReceiptContact> source
Get member's receipt contact.
Throw:
* |
error if receipt contact not found |
public getSubscriber(subscriberId: string): Promise<Subscriber> source
Gets a specific subscriber by Id
Params:
Name | Type | Attribute | Description |
subscriberId | string | id of the subscriber |
Throw:
* |
error if subscriber not found |
public getTestBankNotification(subscriberId: string, notificationId: string): Promise<Notification> source
Gets test bank notification.
public getTestBankNotifications(subscriberId: string): Promise<Array<Notification>> source
Gets test bank notifications.
Params:
Name | Type | Attribute | Description |
subscriberId | string | id of subscriber |
public getToken(tokenId: string): Promise<Token> source
Looks up a token by its Id
Params:
Name | Type | Attribute | Description |
tokenId | string | id of the 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.
Throw:
* |
error if token blob not found |
public getTransaction(accountId: string, transactionId: string, keyLevel: string): Promise<Transaction> source
Looks up a 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
public getTransfer(transferId: string): Promise<Transfer> source
Looks up a transfer
Params:
Name | Type | Attribute | Description |
transferId | string | id to look up |
Throw:
* |
error if transfer not found |
public getTransferTokens(offset: string, limit: number): Promise<object> source
Looks up all transfer tokens
public getTransfers(tokenId: string, offset: string, limit: number): Promise<object> source
Looks up all of the member's 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:
Name | Type | Attribute | Description |
accountId | string | the bank account id |
public linkAccounts(authorization: OauthBankAuthorization | any): Promise<Array<Account>> source
Links bank accounts to the member
Params:
Name | Type | Attribute | Description |
authorization | OauthBankAuthorization | any | bankAuthorization obtained from bank, or oauthBankAuthorization |
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:
Name | Type | Attribute | Description |
token | Token | string | token to redeem. Can also be a tokenId |
|
amount | number |
|
amount to redeemer |
currency | string |
|
currency to redeem |
description | string |
|
optional transfer description |
destinations | Array<TransferEndpoint> |
|
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. |
public removeAlias(alias: Alias): Promise<void> source
Removes an alias from the memberId
Params:
Name | Type | Attribute | Description |
alias | Alias | alias to remove |
public removeKey(keyId: string): Promise<void> source
Removes a key from this member
Params:
Name | Type | Attribute | Description |
keyId | string | keyId to remove. Note, keyId is the hash of the pk |
public removeTrustedBeneficiary(memberId: string): Promise<void> source
Removes a Token member from this member's list of trusted beneficiaries.
Params:
Name | Type | Attribute | Description |
memberId | string | member ID of the trusted beneficiary to remove |
public replaceAccessToken(tokenToCancel: Token | string, newResources: Array<Resource>): Promise<TokenOperationResult> source
Cancels the existing token and creates a replacement for it.
public replaceAndEndorseAccessToken(tokenToCancel: Token | string, newResources: Array<Resource>): Promise<TokenOperationResult> source
public resolveTransferDestinations(accountId: string): Promise<TransferEndpoint[]> source
Resolves transfer destinations for the given account ID.
Params:
Name | Type | Attribute | Description |
accountId | string | id of account to resolve destinations for |
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:
Name | Type | Attribute | Description |
accountId | string | the bank account id |
public setProfile(profile: Profile): Promise<Profile> source
Replaces the authenticated member's public profile.
Params:
Name | Type | Attribute | Description |
profile | Profile | profile to set |
public setProfilePicture(type: string, data: Uint8Array | Array<number>): Promise<void> source
Uploads the authenticated member's public profile.
Params:
Name | Type | Attribute | Description |
type | string | MIME type |
|
data | Uint8Array | Array<number> | data in bytes |
public setReceiptContact(type: stringliteral, value: string): Promise<void> source
Replaces member's receipt contact.
Params:
Name | Type | Attribute | Description |
type | stringliteral |
|
receipt contact type, can only be EMAIL currently |
value | string | receipt contact value for corresponding type |
public setSecurityMetadata(securityMetadata: SecurityMetadata): void source
Sets the security metadata to be sent with each request.
Params:
Name | Type | Attribute | Description |
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.
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:
Name | Type | Attribute | Description |
tokenRequest | TokenRequest | token request to store |
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
public triggerBalanceStepUpNotification(accountIds: Array<string>): Promise<NotifyStatusEnum> source
Triggers a balance step up notification on the user's app
public triggerStepUpNotification(tokenId: string): Promise<NotifyStatusEnum> source
Triggers a token step up notification on the user's app
Params:
Name | Type | Attribute | Description |
tokenId | string | token ID |
public triggerTransactionStepUpNotification(accountId: string, transactionId: string): Promise<NotifyStatusEnum> source
Triggers a transaction step up notification on the user's app
public unlinkAccounts(accountIds: Array<string>): Promise<void> source
Unlinks bank accounts previously linked by the linkAccounts call.
public unsubscribeFromNotifications(subscriberId: string): Promise<void> source
Unsubscribes from notifications (removes a subscriber)
Params:
Name | Type | Attribute | Description |
subscriberId | string | subscriber to remove |
public useAccessToken(accessTokenId: string): void source
Sets the access token id to be used with this client.
Params:
Name | Type | Attribute | Description |
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.)
public verifyAffiliate(memberId: string): Promise<void> source
Verifies and affiliated TPP.
Params:
Name | Type | Attribute | Description |
memberId | string | id of the member to verify |