[PAN-2970] Added privacy group ID for sendRawTransaction (#1773)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
MadelineMurray 5 years ago committed by GitHub
parent cbf5966f17
commit f590c71e93
  1. 34
      docs/Reference/web3js-eea-Methods.md

@ -12,7 +12,7 @@ The Options parameter has the following properties:
* `privateKey`: Ethereum private key with which to sign the transaction
* `privateFrom` : Orion public key of the sender
* `privateFor` : Orion public keys of recipients
* [`privateFor` : Orion public keys of recipients or `privacyGroupId`: Privacy group to receive the transaction](../Privacy/Explanation/Privacy-Groups.md)
* `nonce` : Optional. If not provided, calculated using [`eea_getTransctionCount`](../Reference/Pantheon-API-Methods.md).
* `to` : Optional. Contract address to send the transaction to. Do not specify for contract deployment transactions
* `data` : Transaction data
@ -186,6 +186,8 @@ Private transaction receipt
Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRawTransaction`](Pantheon-API-Methods.md#eea_sendrawtransaction).
`sendRawTransaction` supports [EEA-compliant privacy](../Privacy/How-To/EEA-Compliant.md) using `privateFor`, or [Pantheon-extended privacy](../Privacy/How-To/Pantheon-Privacy.md) using `privacyGroupId`.
**Parameters**
[Transaction options](#options-parameter)
@ -194,8 +196,32 @@ Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRa
`string` : Transaction hash of the [`privacy marker transaction`](../Privacy/Explanation/Private-Transaction-Processing.md)
!!! example
```bash tab="Contract Deployment"
!!! example "Pantheon-extended Privacy"
```bash tab="Contract Deployment with privacyGroupId"
const createPrivateEmitterContract = privacyGroupId => {
const contractOptions = {
data: `0x${binary}`,
privateFrom: orion.node1.publicKey,
privacyGroupId,
privateKey: pantheon.node1.privateKey
};
return web3.eea.sendRawTransaction(contractOptions);
};
```
```bash tab="Contract Invocation with privacyGroupId "
const functionCall = {
to: address,
data: functionAbi.signature,
privateFrom,
privacyGroupId,
privateKey
};
return web3.eea.sendRawTransaction(functionCall);
```
!!! example "EEA-compliant Privacy"
```bash tab="Contract Deployment with privateFor"
const createPrivateEmitterContract = () => {
const contractOptions = {
data: `0x${binary}`,
@ -207,7 +233,7 @@ Signs and sends a RLP-encoded private transaction to Pantheon using [`eea_sendRa
};
```
```bash tab="Contract Invocation"
```bash tab="Contract Invocation with privateFor"
const functionCall = {
to: address,
data: functionAbi.signature + functionArgs,

Loading…
Cancel
Save