Skip to content

Commit 6ab6277

Browse files
committed
docs: privacy APIs
1 parent 116bb45 commit 6ab6277

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docs/api.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,57 @@
11

22
# API
33

4+
## Privacy APIs
5+
6+
### `web3.eth.sendTransaction(object)` was modified to support private transactions
7+
8+
```js
9+
web3.eth.sendTransaction(transactionObject [, callback])
10+
```
11+
12+
Sends a transaction to the network.
13+
14+
##### Parameters
15+
16+
1. `Object` - The transaction object to send:
17+
- `from`: `String` - The address for the sending account. Uses the [web3.eth.defaultAccount](#web3ethdefaultaccount) property, if not specified.
18+
- `to`: `String` - (optional) The destination address of the message, left undefined for a contract-creation transaction.
19+
- `value`: `Number|String|BigNumber` - (optional) The value transferred for the transaction in Wei, also the endowment if it's a contract-creation transaction.
20+
- `gas`: `Number|String|BigNumber` - (optional, default: To-Be-Determined) The amount of gas to use for the transaction (unused gas is refunded).
21+
- <strike>`gasPrice`: `Number|String|BigNumber` - (optional, default: To-Be-Determined) The price of gas for this transaction in wei, defaults to the mean network gas price.</strike>
22+
- `data`: `String` - (optional) Either a [byte string](https://github.com/ethereum/wiki/wiki/Solidity,-Docs-and-ABI) containing the associated data of the message, or in the case of a contract-creation transaction, the initialisation code.
23+
- `nonce`: `Number` - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
24+
- `privateFrom`: `String` - (optional) When sending a private transaction, the sending party's base64-encoded public key to use. If not present *and* passing `privateFor`, use the default key as configured in the `TransactionManager`.
25+
- `privateFor`: `List<String>` - (optional) When sending a private transaction, an array of the recipients' base64-encoded public keys.
26+
2. `Function` - (optional) If you pass a callback the HTTP request is made asynchronous. See [this note](#using-callbacks) for details.
27+
28+
##### Returns
29+
30+
`String` - The 32 Bytes transaction hash as HEX string.
31+
32+
If the transaction was a contract creation use [web3.eth.getTransactionReceipt()](#web3gettransactionreceipt) to get the contract address, after the transaction was mined.
33+
34+
##### Example
35+
36+
```js
37+
// compiled solidity source code using https://chriseth.github.io/cpp-ethereum/
38+
var code = "603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b6007600435028060005260206000f3";
39+
40+
web3.eth.sendTransaction({
41+
data: code,
42+
privateFor: ["ROAZBWtSacxXQrOe3FGAqJDyJjFePR5ce4TSIzmJ0Bc="]
43+
},
44+
function(err, address) {
45+
if (!err) {
46+
console.log(address); // "0x7f9fade1c0d57a7af66ab4ead7c2eb7b11a91385"
47+
}
48+
}
49+
});
50+
```
51+
52+
53+
## QuorumChain APIs
54+
455
Quorum provides an API to inspect the current state of the voting contract.
556

657
### `quorum.nodeInfo` returns the quorum capabilities of this node

0 commit comments

Comments
 (0)