Version: 0.14.0

Class: Messaging

"Messaging".Messaging

Hierarchy#

  • Messaging

Constructors#

constructor#

+ new Messaging(params: { currencyNetwork: CurrencyNetwork ; provider: Provider ; user: User }): Messaging

Defined in src/Messaging.ts:22

Parameters:#

NameType
params{ currencyNetwork: CurrencyNetwork ; provider: Provider ; user: User }

Returns: Messaging

Methods#

messageStream#

messageStream(reconnectingOptions?: ReconnectingWSOptions): Observable<any>

Defined in src/Messaging.ts:153

Returns a websocket observable that can be subscribed to.

Parameters:#

NameType
reconnectingOptions?ReconnectingWSOptions

Returns: Observable<any>


paymentMessage#

paymentMessage(counterPartyAddress: string, transferId: string, subject: string): Promise<PaymentMessage>

Defined in src/Messaging.ts:135

Sends a payment message to given counterParty and returns created message.

Parameters:#

NameTypeDescription
counterPartyAddressstringAddress of counter party.
transferIdstringTransfer ID of the payment
subjectstringSubject that will be sent to the counterparty

Returns: Promise<PaymentMessage>


paymentRequest#

paymentRequest(networkAddress: string, counterPartyAddress: string, value: number | string, subject?: string, options?: { decimalsOptions?: DecimalsOptions }): Promise<PaymentRequestMessage>

Defined in src/Messaging.ts:41

Sends a payment request to given counterParty and returns created payment request.

Parameters:#

NameTypeDefault valueDescription
networkAddressstring-Address of currency network.
counterPartyAddressstring-Address of counter party.
valuenumber | string-Requested payment amount.
subject?string-Optional subject of payment request.
options{ decimalsOptions?: DecimalsOptions }{}-

Returns: Promise<PaymentRequestMessage>


paymentRequestCancel#

paymentRequestCancel(counterPartyAddress: string, id: string, subject?: string): Promise<PaymentRequestDeclineMessage>

Defined in src/Messaging.ts:114

Sends a payment request cancel message to given counterParty and returns created message.

Parameters:#

NameTypeDescription
counterPartyAddressstringAddress of counter party.
idstringid of the payment request to cancel matches either the nonce as a number or id of a payment request as a hex string.
subject?stringOptional subject of cancel message.

Returns: Promise<PaymentRequestDeclineMessage>


paymentRequestDecline#

paymentRequestDecline(counterPartyAddress: string, id: string, subject?: string): Promise<PaymentRequestDeclineMessage>

Defined in src/Messaging.ts:92

Sends a payment request decline message to given counterParty and returns created message.

Parameters:#

NameTypeDescription
counterPartyAddressstringAddress of counter party.
idstringid of the payment request to decline matches either the nonce as a number or id of a payment request as a hex string.
subject?stringOptional subject of decline message.

Returns: Promise<PaymentRequestDeclineMessage>


sendUsernameToCounterparty#

sendUsernameToCounterparty(username: string, counterpartyAddress: string): Promise<UsernameMessage>

Defined in src/Messaging.ts:184

Sends the given username to the specified counter party via messaging.

Parameters:#

NameTypeDescription
usernamestringUsername to send.
counterpartyAddressstring-

Returns: Promise<UsernameMessage>