priv

Methods

(inner) call(privacyGroupId, call, blockNumber) → {Data}

Source:

Invokes a private contract function locally and does not change the privacy group state.

Parameters:
Name Type Description
privacyGroupId String

privacy group ID

call Object

transaction call object

blockNumber String

integer representing a block number or one of the string tags latest, earliest, or pending

Returns:

result return value of the executed contract

Type
Data

(inner) createPrivacyGroup(options) → {String}

Source:
Parameters:
Name Type Description
options Object

request options object with the following fields:

Properties
Name Type Description
addresses Array.<String>

list of nodes specified by Enclave public keys

name String

(optional) privacy group name

description String

(optional) privacy group description

Returns:

privacy group ID

Type
String

(inner) debugGetStateRoot(privacyGroupId, blockNumber) → {String}

Source:
Parameters:
Name Type Description
privacyGroupId String

32-byte privacy Group ID

blockNumber String | Number
Returns:

32-byte state root

Type
String

(inner) deletePrivacyGroup(privacyGroupId) → {String}

Source:
Parameters:
Name Type Description
privacyGroupId String

privacy group ID

Returns:

deleted privacy group ID

Type
String

(inner) distributeRawTransaction(transaction) → {String}

Source:
Parameters:
Name Type Description
transaction String

signed RLP-encoded private transaction

Returns:

32-byte enclave key

Type
String

(inner) findPrivacyGroup(members) → {Array.<Object>}

Source:
Parameters:
Name Type Description
members Array.<String>

members specified by Enclave public keys

Returns:

privacy group objects

Type
Array.<Object>

(inner) generateAndDistributeRawTransaction(options) → {Promise.<T>}

Source:

Generate and distribute the Raw transaction to the Besu node using the priv_distributeRawTransaction JSON-RPC call

Parameters:
Name Type Description
options object

Map to send a raw transaction to besu

Properties
Name Type Attributes Description
privateKey string

Private Key used to sign transaction with

privateFrom string

Enclave public key

privateFor string

Enclave keys to send the transaction to

privacyGroupId string

Enclave id representing the receivers of the transaction

nonce string <optional>

If not provided, will be calculated using priv_getTransactionCount

to string

The address to send the transaction

data string

Data to be sent in the transaction

Returns:
Type
Promise.<T>

(inner) generateAndSendRawTransaction(options) → {Promise.<T>}

Source:

Generate and send the Raw transaction to the Besu node using the eea_sendRawTransaction JSON-RPC call

Parameters:
Name Type Description
options object

Map to send a raw transaction to besu

Properties
Name Type Attributes Description
privateKey string

Private Key used to sign transaction with

privateFrom string

Enclave public key

privateFor string

Enclave keys to send the transaction to

privacyGroupId string

Enclave id representing the receivers of the transaction

nonce string <optional>

If not provided, will be calculated using priv_getTransactionCount

to string

The address to send the transaction

data string

Data to be sent in the transaction

gasLimit string

The gas limit to use for the privacy marker transaction (if applicable)

gasPrice string

The gas price to use for the privacy marker transaction (if applicable)

Returns:
Type
Promise.<T>

(inner) getCode(privacyGroupId, address, blockNumber) → {String}

Source:
Parameters:
Name Type Description
privacyGroupId String

32-byte privacy Group ID

address String

20-byte contract address

blockNumber String | Number
Returns:

code stored at the specified address

Type
String

(inner) getEeaTransactionCount(address, sender, recipients) → {String}

Source:
Parameters:
Name Type Description
address String

account address

sender String

base64-encoded Enclave address of the sender

recipients Array.<String>

base64-encoded Enclave addresses of recipients

Returns:

integer representing the number of private transactions sent from the address to the specified group of sender and recipients

Type
String

(inner) getFilterChanges(privacyGroupId, filterId) → {Array.<Object>}

Source:
Parameters:
Name Type Description
privacyGroupId String

32-byte privacy Group ID

filterId String

filter ID

Returns:

list of log objects, or an empty list if nothing has changed since the last poll

Type
Array.<Object>

(inner) getFilterLogs(privacyGroupId, filterId) → {Array.<Object>}

Source:
Parameters:
Name Type Description
privacyGroupId String

32-byte privacy Group ID

filterId String

filter ID

Returns:

list of log objects

Type
Array.<Object>

(inner) getLogs(privacyGroupId, filterOptions) → {Array.<Object>}

Source:
Parameters:
Name Type Description
privacyGroupId String

32-byte privacy Group ID

filterOptions Object

filter options object

Returns:

list of log objects

Type
Array.<Object>

(inner) getPrivacyPrecompileAddress() → {String}

Source:
Returns:

address of the privacy precompile

Type
String

(inner) getPrivateTransaction(transaction) → {Object}

Source:
Parameters:
Name Type Description
transaction String

transaction hash returned by eea_sendRawTransaction or eea_sendTransaction.

Returns:

private transaction object, or null if not a participant in the private transaction

Type
Object

(inner) getTransactionCount(address, privacyGroupId) → {String}

Source:
Parameters:
Name Type Description
address String

account address

privacyGroupId String

privacy group ID

Returns:

integer representing the number of private transactions sent from the address to the specified privacy group

Type
String

(inner) getTransactionReceipt(transaction) → {Object}

Source:
Parameters:
Name Type Description
transaction String

32-byte hash of a transaction

Returns:

private Transaction receipt object, or null if no receipt found

Type
Object

(inner) newFilter(privacyGroupId, filterOptions) → {String}

Source:
Parameters:
Name Type Description
privacyGroupId String

32-byte privacy Group ID

filterOptions Object

filter options object

Returns:

filter ID

Type
String

(inner) sendRawTransaction(transaction) → {String}

Source:
Parameters:
Name Type Description
transaction String

signed RLP-encoded private transaction

Returns:

32-byte transaction hash of the Privacy Marker Transaction

Type
String

(inner) subscribe(privacyGroupId, type, filter) → {Sting}

Source:
Parameters:
Name Type Description
privacyGroupId String
type String
filter Object
Returns:

Subscription ID

Type
Sting

(inner) subscribeWithPooling(privacyGroupId, filter, callback) → {PrivateSubscription}

Source:

Subscribe to new logs matching a filter

If the provider supports subscriptions, it uses priv_subscribe, otherwise it uses polling and priv_getFilterChanges to get new logs. Returns an error to the callback if there is a problem subscribing or creating the filter.

Parameters:
Name Type Description
privacyGroupId string
filter *
callback function

returns the filter/subscription ID, or an error

Returns:

a subscription object that manages the lifecycle of the filter or subscription

Type
PrivateSubscription

(inner) uninstallFilter(privacyGroupId, filterOptions) → {Boolean}

Source:
Parameters:
Name Type Description
privacyGroupId String

32-byte privacy Group ID

filterOptions Object

filter options object

Returns:

indicates if the filter is successfully uninstalled

Type
Boolean

(inner) unsubscribe(privacyGroupId, subscriptionId) → {Boolean}

Source:
Parameters:
Name Type Description
privacyGroupId String
subscriptionId String
Returns:

true if subscription successfully unsubscribed; otherwise, returns an error.

Type
Boolean

(inner) waitForTransactionReceipt(txHash, retriesopt, delayopt) → {Promise.<T>}

Source:

Get the private transaction Receipt with waiting until the receipt is ready.

Parameters:
Name Type Attributes Default Description
txHash string

Transaction Hash of the marker transaction

retries int <optional>
300

Number of retries to be made to get the private marker transaction receipt

delay int <optional>
1000

The delay between the retries in milliseconds

Returns:
Type
Promise.<T>