@@ -44,70 +44,69 @@ Compatibility Matrix
44
44
Older versions
45
45
--------------------
46
46
47
- #### Versions 4.x.x
47
+ ** Version 4.x.x**
48
48
49
+ As part of the changes in the BigchainDB 2.0 server, some endpoints were
50
+ modified. In order to be consistent with them, the JS driver does not have
51
+ anymore the `pollStatusAndFetchTransaction() ` method as there are three
52
+ different ways of posting a transaction:
49
53
54
+ - `async ` using the `postTransaction `: the response will return immediately and not wait to see if the transaction is valid.
55
+ - `sync ` using the `postTransactionSync `: the response will return after the transaction is validated.
56
+ - `commit ` using the `postTransactionCommit `: the response will return after the transaction is committed to a block.
50
57
51
- As part of the changes in the BigchainDB 2.0 server, some endpoint were
52
- modified. In order to be consistent with them, the JS driver does not have
53
- anymore the `pollStatusAndFetchTransaction() ` method as there are three
54
- different ways of posting a transaction.
55
- - `async ` using the `postTransaction `: the response will return immediately and not wait to see if the transaction is valid.
56
- - `sync ` using the `postTransactionSync `: the response will return after the transaction is validated.
57
- - `commit ` using the `postTransactionCommit `: the response will return after the transaction is committed to a block.
58
+ By default in the docs we will use the `postTransactionCommit ` as is way of
59
+ being sure that the transaction is validated and commited to a block, so
60
+ there will not be any issue if you try to do any other action with the asset immediately.
58
61
59
- By default in the docs we will use the `postTransactionCommit ` as is way of
60
- being sure that the transaction is validated and commited to a block, so
61
- there will not be any issue if you try to transfer the asset immediately.
62
62
63
+ **Version 3.2.x **
63
64
64
- #### Versions 3.2.x
65
+ For versions below 3.2, a transfer transaction looked like:
65
66
66
- For versions below 3.2, a transfer transaction looked like:
67
+ .. code-block :: js
67
68
68
- .. code-block :: js
69
+ const createTranfer = BigchainDB .Transaction .makeTransferTransaction (
70
+ txCreated,
71
+ metadata, [BigchainDB .Transaction .makeOutput (
72
+ BigchainDB .Transaction .makeEd25519Condition (alice .publicKey ))],
73
+ 0
74
+ )
69
75
70
- const createTranfer = BigchainDB .Transaction .makeTransferTransaction (
71
- txCreated,
72
- metadata, [BigchainDB .Transaction .makeOutput (
73
- BigchainDB .Transaction .makeEd25519Condition (alice .publicKey ))],
74
- 0
75
- )
76
-
77
- const signedTransfer = BigchainDB .Transaction .signTransaction (createTranfer,
78
- keypair .privateKey )
76
+ const signedTransfer = BigchainDB .Transaction .signTransaction (createTranfer,
77
+ keypair .privateKey )
79
78
80
79
81
- In order to upgrade and do it compatible with the new driver version, this
82
- transaction should be now:
80
+ In order to upgrade and do it compatible with the new driver version, this
81
+ transaction should be now:
83
82
84
- .. code-block :: js
83
+ .. code-block :: js
85
84
86
- const createTranfer = BigchainDB .Transaction .makeTransferTransaction (
87
- [{ tx: txCreated, output_index: 0 }],
88
- [BigchainDB .Transaction .makeOutput (
89
- BigchainDB .Transaction .makeEd25519Condition (alice .publicKey ))],
90
- metaData
91
- )
85
+ const createTranfer = BigchainDB .Transaction .makeTransferTransaction (
86
+ [{ tx: txCreated, output_index: 0 }],
87
+ [BigchainDB .Transaction .makeOutput (
88
+ BigchainDB .Transaction .makeEd25519Condition (alice .publicKey ))],
89
+ metaData
90
+ )
92
91
93
- const signedTransfer = BigchainDB .Transaction .signTransaction (createTranfer,
94
- keypair .privateKey )
92
+ const signedTransfer = BigchainDB .Transaction .signTransaction (createTranfer,
93
+ keypair .privateKey )
95
94
96
95
97
- The upgrade allows to create transfer transaction spending outputs that belong
98
- to different transactions. So for instance is now possible to create a transfer
99
- transaction spending two outputs from two different create transactions:
96
+ The upgrade allows to create transfer transaction spending outputs that belong
97
+ to different transactions. So for instance is now possible to create a transfer
98
+ transaction spending two outputs from two different create transactions:
100
99
101
100
102
- .. code-block :: js
101
+ .. code-block :: js
103
102
104
- const createTranfer = BigchainDB .Transaction .makeTransferTransaction (
105
- [{ tx: txCreated1, output_index: 0 },
106
- { tx: txCreated2, output_index: 0 }],
107
- [BigchainDB .Transaction .makeOutput (
108
- BigchainDB .Transaction .makeEd25519Condition (alice .publicKey ))],
109
- metaData
110
- )
103
+ const createTranfer = BigchainDB .Transaction .makeTransferTransaction (
104
+ [{ tx: txCreated1, output_index: 0 },
105
+ { tx: txCreated2, output_index: 0 }],
106
+ [BigchainDB .Transaction .makeOutput (
107
+ BigchainDB .Transaction .makeEd25519Condition (alice .publicKey ))],
108
+ metaData
109
+ )
111
110
112
- const signedTransfer = BigchainDB .Transaction .signTransaction (createTranfer,
113
- keypair .privateKey )
111
+ const signedTransfer = BigchainDB .Transaction .signTransaction (createTranfer,
112
+ keypair .privateKey )
0 commit comments