Skip to content

Commit

Permalink
docs(0004): BREAKING remove cancellationCondition
Browse files Browse the repository at this point in the history
what was previously known as Universal mode has been incorporated into the core Interledger Protocol. the Atomic mode is being removed from the core protocol and will be used via extensions to the protocol.
based on #28
  • Loading branch information
emschwartz committed Aug 1, 2016
1 parent aa941c9 commit 179e434
Showing 1 changed file with 3 additions and 40 deletions.
43 changes: 3 additions & 40 deletions 0004-ledger-plugin-interface/0004-ledger-plugin-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ This spec depends on the [ILP spec](../0003-interledger-protocol/).
| [**error**](#event-error-) | `( ) ⇒` |
| [**receive**](#event-receive-) | <code>( transfer:[IncomingTransfer](#incomingtransfer) ) ⇒</code> |
| [**fulfill_execution_condition**](#event-fulfill_execution_condition-) | <code>( transfer:[Transfer](#class-transfer), fulfillment:Buffer ) ⇒</code> |
| [**fulfill_cancellation_condition**](#event-fulfill_cancellation_condition-) | <code>( transfer:[Transfer](#class-transfer), fulfillment:Buffer ) ⇒</code> |
| [**reject**](#event-reject-) | <code>( transfer:[OutgoingTransfer](#outgoingtransfer), rejectionReason:Buffer ) ⇒</code> |
| [**reply**](#event-reply-) | <code>( transfer:[OutgoingTransfer](#outgoingtransfer), replyMessage:Buffer ) ⇒</code> |

Expand Down Expand Up @@ -191,15 +190,8 @@ p.send({
amount: '10',
data: new Buffer('...', 'base64'),
noteToSelf: {},

// for UTP/ATP support
executionCondition: 'cc:0:3:47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU:0',

// for UTP support
expiresAt: '2016-05-18T12:00:00.000Z',

// for ATP support
cancellationCondition: 'cc:0:3:47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU:0'
expiresAt: '2016-05-18T12:00:00.000Z'
})
```

Expand All @@ -220,7 +212,7 @@ Submit a fulfillment to a ledger. Plugin must be connected, otherwise the promis

Emitted when a transfer is received.

Note that transfers may be conditional, in which case the `receive` event **DOES NOT** indicate that money has been transferred. If users of the plugin wish to check whether they have gotten money, they MUST check whether the transfer has a condition. If transfers have conditions, the final status will only be known when the [fulfill_execution_condition](#event-fulfill_execution_condition-) or [fulfill_cancellation_condition](#event-fulfill_cancellation_condition-) are emitted.
Note that transfers may be conditional, in which case the `receive` event **DOES NOT** indicate that money has been transferred. If users of the plugin wish to check whether they have gotten money, they MUST check whether the transfer has a condition. If transfers have conditions, the final status will only be known when the [fulfill_execution_condition](#event-fulfill_execution_condition-) is emitted.

The ledger plugin MUST authenticate the source for all incoming transfers, whether they include money or not.

Expand All @@ -233,15 +225,8 @@ The ledger plugin MUST authenticate the source for all incoming transfers, wheth
amount: '10',
data: Buffer(...),
noteToSelf: {},

// for UTP/ATP support
executionCondition: 'cc:0:3:47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU:0',

// for UTP support
expiresAt: '2016-05-18T12:00:00.000Z',

// for ATP support
cancellationCondition: 'cc:0:3:47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU:0'
expiresAt: '2016-05-18T12:00:00.000Z'
}
```

Expand All @@ -259,18 +244,6 @@ Emitted when a transfer's execution condition has been fulfilled.

If the transfer is an [`OutgoingTransfer`](#outgoingtransfer), connectors will forward the execution condition to the corresponding [`IncomingTransfer`](#incomingtransfer).

#### Event: `fulfill_cancellation_condition`
<code style="">ledgerPlugin.on('fulfill_cancellation_condition',
(
**transfer**:[Transfer](#class-transfer),
**fulfillment**:Buffer
) ⇒
)</code>

Emitted when a transfer's cancellation condition has been fulfilled.

If the transfer is an [`IncomingTransfer`](#incomingtransfer), connectors will forward the execution condition to the corresponding [`OutgoingTransfer`](#outgoingtransfer).

#### Event: `reject`
<code>ledgerPlugin.on('reject',
(
Expand Down Expand Up @@ -308,7 +281,6 @@ fields can be left undefined (but not any other false-y value) if unused.
| `Buffer` | [data](#data) | Data packet or memo to be sent with the transfer, starts with an ILP header |
| `Buffer` | [noteToSelf](#notetoself) | Host-provided memo that should be stored with the transfer |
| `String` | [executionCondition](#executioncondition) | Cryptographic hold condition, used in [UTP](../0006-universal-transport-protocol/)/[ATP](../0007-atomic-transport-protocol/) |
| `String` | [cancellationCondition](#cancellationcondition) | Cryptographic abort condition, used in [ATP](../0007-atomic-transport-protocol/) |
| `String` | [expiresAt](#expiresat) | Expiry time of the cryptographic hold, used in [UTP](../0006-universal-transport-protocol/) |
| `Object` | [custom](#custom) | Object containing ledger plugin specific options |

Expand Down Expand Up @@ -375,15 +347,6 @@ Ledger plugins that do not support holds MUST throw an `HoldsNotSupportedError`

Ledger plugins that do support holds, but do not support the given condition type or bitmask MUST throw a `ExecutionConditionNotSupportedError`.

#### cancellationCondition
<code>**cancellationCondition**:String</code>

A [cryptographic condition](../0002-crypto-conditions/) used for implementing holds. If this condition is met and the transfer is on hold, the ledger MUST cancel the transfer and return the funds to the sender.

Ledger plugins that do not support holds or do not support cancellation MUST throw a `CancellationNotSupportedError` if this parameter is provided.

Ledger plugins that do support cancellation, but do not support the given condition type or bitmask MUST throw a `CancellationConditionNotSupportedError`.

#### expiresAt
<code>**expiresAt**:String</code>

Expand Down

0 comments on commit 179e434

Please sign in to comment.