File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -107,17 +107,20 @@ export class Messaging {
107107 /**
108108 * Sends a payment request cancel message to given `counterParty` and returns created message.
109109 * @param counterPartyAddress Address of counter party.
110- * @param id id of the payment request to decline
110+ * @param id id of the payment request to cancel
111111 * matches either the nonce as a number or id of a payment request as a hex string.
112+ * @param subject Optional subject of cancel message.
112113 */
113114 public async paymentRequestCancel (
114115 counterPartyAddress : string ,
115- id : string
116+ id : string ,
117+ subject ?: string
116118 ) : Promise < PaymentRequestDeclineMessage > {
117119 const type = 'PaymentRequestCancel'
118120 const message = {
119121 type,
120- id
122+ id,
123+ subject
121124 }
122125 await this . sendMessage ( counterPartyAddress , type , message )
123126 return message
Original file line number Diff line number Diff line change @@ -74,10 +74,12 @@ describe('e2e', () => {
7474 it ( 'should return sent cancel' , async ( ) => {
7575 const cancelMessage = await tl1 . messaging . paymentRequestCancel (
7676 tl2 . user . address ,
77- '0x10'
77+ '0x10' ,
78+ 'test subject'
7879 )
7980 expect ( cancelMessage . type ) . to . equal ( 'PaymentRequestCancel' )
8081 expect ( cancelMessage . id ) . to . equal ( '0x10' )
82+ expect ( cancelMessage . subject ) . to . equal ( 'test subject' )
8183 } )
8284 } )
8385
You can’t perform that action at this time.
0 commit comments