TransferTokenBuilder
Constructor Summary
Public Constructor | ||
public |
constructor(client: Object, member: Object, lifetimeAmount: number, currency: string) Represents a Builder for a transfer token. |
Member Summary
Private Members | ||
private |
_blobPayloads: *[] |
|
private |
_client: * |
|
private |
_member: * |
|
private |
_payload: {"version": *, "refId": *, "transfer": *} |
|
private |
|
Method Summary
Public Methods | ||
public |
addAttachment(attachment: Object): TransferTokenBuilder Adds an attachment to the token. |
|
public |
addAttachmentData(ownerId: string, type: string, name: string, data: Buffer): TransferTokenBuilder Adds an attachment to the token, with the data. |
|
public |
addDestination(endpoint: object): TransferTokenBuilder Add a transfer destination to the token. |
|
public |
Builds the token payload. |
|
public |
Executes the createToken API call to the server, and returns a promise with the token. |
|
public |
setAccountId(accountId: string): TransferTokenBuilder Sets the source accountId of the token. |
|
public |
setActingAs(actingAs: Object): TransferTokenBuilder Sets acting as on the token. |
|
public |
setChargeAmount(chargeAmount: number): TransferTokenBuilder Sets the maximum charge amount of the token. |
|
public |
setCustomAuthorization(bankId: string, authorization: string): TransferTokenBuilder Sets the source custom authorization. |
|
public |
setDescription(description: string): TransferTokenBuilder Sets the description of the token. |
|
public |
setEffectiveAtMs(effectiveAtMs: number): TransferTokenBuilder Sets the effective date of the token. |
|
public |
setEndorseUntilMs(endorseUntilMs: number): TransferTokenBuilder Sets the endorse token timeout. |
|
public |
setExpiresAtMs(expiresAtMs: number): TransferTokenBuilder Sets the expiration date of the token. |
|
public |
setFromId(memberId: string): TransferTokenBuilder Sets the fromId of the token |
|
public |
setPricing(pricing: Object): TransferTokenBuilder Sets the pricing (fees/fx) of the token. |
|
public |
setPurposeOfPayment(purposeOfPayment: string): TransferTokenBuilder Sets the purpose of payment of the token. |
|
public |
setReceiptRequested(receiptRequested: boolean): TransferTokenBuilder Sets the flag indicating whether a receipt is requested. |
|
public |
setRedeemerAlias(redeemerAlias: Object): TransferTokenBuilder this method was deprecated. - use setToAlias
Sets the alias of the redeemer. |
|
public |
setRedeemerMemberId(redeemerMemberId: Object): TransferTokenBuilder this method was deprecated. - use setToMemberId
Sets the memberId of the redeemer. |
|
public |
setRefId(refId: string): TransferTokenBuilder Sets the refId on the token. |
|
public |
setToAlias(toAlias: Object): TransferTokenBuilder Sets the alias of the payee. |
|
public |
setToMemberId(toMemberId: string): TransferTokenBuilder Sets the memberId of the payee. |
|
public |
setTokenRequestId(tokenRequestId: string): TransferTokenBuilder Sets the token request ID. |
Public Constructors
Private Members
private _blobPayloads: *[] source
private _client: * source
private _member: * source
private _payload: {"version": *, "refId": *, "transfer": *} source
Public Methods
public addAttachment(attachment: Object): TransferTokenBuilder source
Adds an attachment to the token.
Params:
Name | Type | Attribute | Description |
attachment | Object | attachment (metadata). |
public addAttachmentData(ownerId: string, type: string, name: string, data: Buffer): TransferTokenBuilder source
Adds an attachment to the token, with the data.
public addDestination(endpoint: object): TransferTokenBuilder source
Add a transfer destination to the token.
Params:
Name | Type | Attribute | Description |
endpoint | object | transfer endpoint |
public async execute(): Promise source
Executes the createToken API call to the server, and returns a promise with the token.
public setAccountId(accountId: string): TransferTokenBuilder source
Sets the source accountId of the token.
Params:
Name | Type | Attribute | Description |
accountId | string | source accountId |
public setActingAs(actingAs: Object): TransferTokenBuilder source
Sets acting as on the token.
Params:
Name | Type | Attribute | Description |
actingAs | Object | entity the redeemer is acting on behalf of |
public setChargeAmount(chargeAmount: number): TransferTokenBuilder source
Sets the maximum charge amount of the token.
Params:
Name | Type | Attribute | Description |
chargeAmount | number | maximum charge amount. |
public setCustomAuthorization(bankId: string, authorization: string): TransferTokenBuilder source
Sets the source custom authorization.
public setDescription(description: string): TransferTokenBuilder source
Sets the description of the token.
Params:
Name | Type | Attribute | Description |
description | string | description |
public setEffectiveAtMs(effectiveAtMs: number): TransferTokenBuilder source
Sets the effective date of the token.
Params:
Name | Type | Attribute | Description |
effectiveAtMs | number | effective date in milliseconds |
public setEndorseUntilMs(endorseUntilMs: number): TransferTokenBuilder source
Sets the endorse token timeout.
Params:
Name | Type | Attribute | Description |
endorseUntilMs | number | time at which no more endorsements can be made |
public setExpiresAtMs(expiresAtMs: number): TransferTokenBuilder source
Sets the expiration date of the token.
Params:
Name | Type | Attribute | Description |
expiresAtMs | number | expiration date in milliseconds |
public setFromId(memberId: string): TransferTokenBuilder source
Sets the fromId of the token
Params:
Name | Type | Attribute | Description |
memberId | string | from memberId |
public setPricing(pricing: Object): TransferTokenBuilder source
Sets the pricing (fees/fx) of the token.
Params:
Name | Type | Attribute | Description |
pricing | Object | pricing of the token |
public setPurposeOfPayment(purposeOfPayment: string): TransferTokenBuilder source
Sets the purpose of payment of the token.
Params:
Name | Type | Attribute | Description |
purposeOfPayment | string | purpose of payment |
public setReceiptRequested(receiptRequested: boolean): TransferTokenBuilder source
Sets the flag indicating whether a receipt is requested.
Params:
Name | Type | Attribute | Description |
receiptRequested | boolean | receipt requested flag |
public setRedeemerAlias(redeemerAlias: Object): TransferTokenBuilder source
Sets the alias of the redeemer.
Params:
Name | Type | Attribute | Description |
redeemerAlias | Object | alias of the redeemer |
public setRedeemerMemberId(redeemerMemberId: Object): TransferTokenBuilder source
Sets the memberId of the redeemer.
Params:
Name | Type | Attribute | Description |
redeemerMemberId | Object | memberId of the redeemer |
public setRefId(refId: string): TransferTokenBuilder source
Sets the refId on the token.
Params:
Name | Type | Attribute | Description |
refId | string | client generated reference id, at most 18 characters long. |
public setToAlias(toAlias: Object): TransferTokenBuilder source
Sets the alias of the payee.
Params:
Name | Type | Attribute | Description |
toAlias | Object | alias of the payee |
public setToMemberId(toMemberId: string): TransferTokenBuilder source
Sets the memberId of the payee.
Params:
Name | Type | Attribute | Description |
toMemberId | string | memberId of the payee |
public setTokenRequestId(tokenRequestId: string): TransferTokenBuilder source
Sets the token request ID.
Params:
Name | Type | Attribute | Description |
tokenRequestId | string | token request id |