diff --git a/README.md b/README.md index 0ce90b2..ad80009 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ | ----------------- |------------------------------| | `0.10` | `0.1.x` | | `1.0.0` | `0.3.x` | -| `>= 1.3.0` | `>= 3.1.x` | +| `>= 1.3.0` | `3.x.x` | ## Breaking changes Version 3.2 of BigchainDB JavaScript Driver introduces a new way of creating transfer transactions. Check [older versions](https://docs.bigchaindb.com/projects/js-driver/en/latest/readme.html#features) diff --git a/docs/source/readme.rst b/docs/source/readme.rst index 50095ad..afccbd1 100644 --- a/docs/source/readme.rst +++ b/docs/source/readme.rst @@ -34,13 +34,13 @@ Compatibility Matrix +-----------------------+----------------------------------+ | ``1.0`` | ``0.3.x`` | +-----------------------+----------------------------------+ -| ``1.3`` | ``3.1.x`` | +| ``1.3`` | ``3.x.x`` | +-----------------------+----------------------------------+ Older versions -------------------- -For versions below 3.2, the transfer transaction is like this: +For versions below 3.2, a transfer transaction looked like: .. code-block:: js @@ -52,3 +52,31 @@ For versions below 3.2, the transfer transaction is like this: ) const signedTransfer = BigchainDB.Transaction.signTransaction(createTranfer, keypair.privateKey) + + +In order to upgrade and do it compatible with the new driver version, this transaction should be now: + +.. code-block:: js + + const createTranfer = BigchainDB.Transaction.makeTransferTransaction( + [{ tx: txCreated, output_index: 0 }], + [aliceOutput], + metaData + ) + + const signedTransfer = BigchainDB.Transaction.signTransaction(createTranfer, keypair.privateKey) + + +The upgrade allows to create transfer transaction spending outputs that belong to different transactions. +So for instance is now possible to create a transfer transaction spending two outputs from two different create transactions: + + +.. code-block:: js + + const createTranfer = BigchainDB.Transaction.makeTransferTransaction( + [{ tx: txCreated1, output_index: 0 }, { tx: txCreated2, output_index: 0 }], + [aliceOutput], + metaData + ) + + const signedTransfer = BigchainDB.Transaction.signTransaction(createTranfer, keypair.privateKey)