|
1 | 1 |
|
2 | 2 | # API
|
3 | 3 |
|
| 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 | + |
4 | 55 | Quorum provides an API to inspect the current state of the voting contract.
|
5 | 56 |
|
6 | 57 | ### `quorum.nodeInfo` returns the quorum capabilities of this node
|
|
0 commit comments