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:Name | Type |
---|---|
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:Name | Type |
---|---|
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:Name | Type | Description |
---|---|---|
counterPartyAddress | string | Address of counter party. |
transferId | string | Transfer ID of the payment |
subject | string | Subject 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:Name | Type | Default value | Description |
---|---|---|---|
networkAddress | string | - | Address of currency network. |
counterPartyAddress | string | - | Address of counter party. |
value | number | 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:Name | Type | Description |
---|---|---|
counterPartyAddress | string | Address of counter party. |
id | string | id of the payment request to cancel matches either the nonce as a number or id of a payment request as a hex string. |
subject? | string | Optional 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:Name | Type | Description |
---|---|---|
counterPartyAddress | string | Address of counter party. |
id | string | id of the payment request to decline matches either the nonce as a number or id of a payment request as a hex string. |
subject? | string | Optional 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:Name | Type | Description |
---|---|---|
username | string | Username to send. |
counterpartyAddress | string | - |
Returns: Promise<UsernameMessage>