# Class: ReceiverLink

## ReceiverLink

#### new ReceiverLink()

##### Fires:

- ReceiverLink#event:message

### Extends

- Link

### Methods

#### accept(message)

Settle a message (or array of messages) with an Accepted delivery outcome

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | string | array | message, or array of messages to settle

#### addCredits(credits, flowOptionsopt)

Add credits to this link

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`credits` | number |  | number of credits to add
`flowOptions` | object | <optional> | additional options to include in flow frame

#### detach(optionsopt) → {Promise}

Detach the link from the session

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`options` | object | <optional> | detach frame options

Inherited From:
  - Link#detach

##### Returns:

Type
  Promise

#### modify(message, optionsopt)

Settle a message (or array of messages) with a Modified delivery outcome

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | string | array |  | message, or array of messages to settle
`options` | object | <optional> | options used for a Modified outcome ###### Properties
Name | Type | Attributes | Description
--- | --- | --- | ---
`deliveryFailed` | boolean | <optional> | count the transfer as an unsuccessful delivery attempt
`undeliverableHere` | boolean | <optional> | prevent redelivery
`messageAnnotations` | object | <optional> | message attributes to combine with existing annotations

#### reject(message, erroropt)

Settle a message (or array of messages) with a Rejected delivery outcome

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | string | array |  | message, or array of messages to settle
`error` | string | <optional> | error that caused the message to be rejected

#### release(message)

Settle a message (or array of messages) with a Released delivery outcome

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | string | array | message, or array of messages to settle

#### settle(message, stateopt)

Settle a message (or array of messages) with a given delivery state

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | string | array |  | message, or array of messages to settle
`state` | object | <optional> | outcome of message delivery

### Events

#### attached

Attached event

Inherited From:
  - Link#event:attached

#### creditChange

Credit change event

#### detached

Detached event

Inherited From:
  - Link#event:detached

#### errorReceived

Error received event

##### Parameters:

Name | Type | Description
--- | --- | ---
`error` | object | the received error

Inherited From:
  - Link#event:errorReceived

#### message

Message received event. Message payload given as argument.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`message` | object |  | the received message
`transferFrame` | object | <optional> | the transfer frame the message was extracted from