Skip to content

Commit

Permalink
docs(lpi2): condition and fulfillment as buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
justmoon committed Dec 14, 2017
1 parent 72cb63a commit e0f7e50
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions 0000-ledger-plugin-interface-2/0000-ledger-plugin-interface-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ This method MAY reject with any arbitrary JavaScript error.
```js
p.sendTransfer({
amount: '10',
executionCondition: '47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU',
executionCondition: Buffer.from('47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU', 'base64'),
expiresAt: '2016-05-18T12:00:00.000Z',
ilp: Buffer.alloc(0),
custom: {}
Expand Down Expand Up @@ -210,15 +210,15 @@ The `Transfer` class is used to describe transfers from the originator of the se
|:--|:--|:--|
| `String` | [amount](#transferamount) | Integer transfer amount, in the ledger's base unit |
| `Buffer` | [ilp](#transferilp) | Attached data (ILP packet) |
| `String` | [executionCondition](#transferexecutioncondition) | Cryptographic hold condition |
| `Buffer` | [executionCondition](#transferexecutioncondition) | Cryptographic hold condition |
| `String` | [expiresAt](#transferexpiresat) | Expiry time of the cryptographic hold |
| `Object` | [custom](#transfercustom) | Object containing ledger plugin specific options |

###### Example
``` js
{
amount: '100',
executionCondition: 'I3TZF5S3n0-07JWH0s8ArsxPmVP6s-0d0SqxR6C3Ifk',
executionCondition: Buffer.from('I3TZF5S3n0-07JWH0s8ArsxPmVP6s-0d0SqxR6C3Ifk', 'base64'),
expiresAt: '2017-12-02T11:51:26.627Z',
ilp: Buffer.alloc(0),
custom: {
Expand Down Expand Up @@ -249,16 +249,16 @@ An [ILP packet](https://interledger.org/rfcs/0003-interledger-protocol/draft-4.h
If the `ilp` data is too large, the ledger plugin MUST reject with a `MaximumIlpDataSizeExceededError`.

#### Transfer#executionCondition
<code>**executionCondition**:String</code>
<code>**executionCondition**:Buffer</code>

A cryptographic challenge used for implementing holds. The underlying ledger MUST hold the transfer until the condition has been fulfilled or the `expiresAt` time has been reached.

Conditions are the base64url-encoded SHA-256 hash of a random or pseudo-random 32-byte preimage called the fulfillment.
The `executionCondition` is a Node.js `Buffer` containing the 32-byte SHA-256 hash of a random or pseudo-random 32-byte preimage called the `fulfillment`.

###### Example

``` js
'I3TZF5S3n0-07JWH0s8ArsxPmVP6s-0d0SqxR6C3Ifk'
Buffer.from('I3TZF5S3n0-07JWH0s8ArsxPmVP6s-0d0SqxR6C3Ifk', 'base64')
```

#### Transfer#expiresAt
Expand Down Expand Up @@ -308,11 +308,11 @@ The `FulfillmentInfo` class is used to describe the fulfillment and associated d
### Fields

#### FulfillmentInfo#fulfillment
<code>**fulfillment**:String</code>
<code>**fulfillment**:Buffer</code>

A cryptographic fulfillment that is the SHA-256 preimage of the hash provided as the [`executionCondition`](#transferexecutioncondition) when the transfer was first prepared.

Fulfillments are base64url-encoded values with a length of exactly 32 bytes.
The `fulfillment` is a Node.js `Buffer` with a length of exactly 32 bytes.

#### FulfillmentInfo#ilp
<code>**ilp**:Buffer</code>
Expand Down

0 comments on commit e0f7e50

Please sign in to comment.