EEAClient

EEAClient

new EEAClient()

Source:

Handles elements

Methods

(static) deletePrivacyGroup(options)

Source:

Delete a privacy group

Parameters:
Name Type Description
options

Options passed into deletePrivacyGroup

  • options.privacyGroupId
Returns:

Promise<transaction count | never>

(static) getMarkerTransaction(txHash, retries, delay)

Source:

Returns the Private Marker transaction

Parameters:
Name Type Description
txHash string

The transaction hash

retries int

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

delay int

The delay between the retries

Returns:

Promise to resolve the private marker transaction receipt

(static) getTransactionCount(options)

Source:

Get the transaction count

Parameters:
Name Type Description
options

Options passed into eea_sendRawTransaction

Returns:

Promise<transaction count | never>

(inner) addToPrivacyGroup(options) → {Promise.<(AxiosResponse.<any>|never)>}

Source:

Add to an existing on-chain privacy group

Parameters:
Name Type Description
options

Map to add the members options map can contain the following:

  • privacyGroupId: Privacy group ID to add to
  • privateKey: Private Key used to sign transaction with
  • enclaveKey: Orion public key
  • participants: list of enclaveKey to pass to the contract to add to the group
Returns:
Type
Promise.<(AxiosResponse.<any>|never)>

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

Source:

Invokes a private contract function locally

Parameters:
Name Type Description
options

Options passed into priv_call options map can contain the following:

  • privacyGroupId: Enclave id representing the receivers of the transaction
  • to: Contract address,
  • data: Encoded function call (signature + data)
  • blockNumber: Blocknumber defaults to "latest"
Returns:
Type
Promise.<AxiosResponse.<T>>

(inner) createXPrivacyGroup(options) → {Promise.<(AxiosResponse.<any>|never)>}

Source:

Create an on chain privacy group

Parameters:
Name Type Description
options

Map to add the members options map can contain the following:

  • privacyGroupId: Privacy group ID to add to
  • privateKey: Private Key used to sign transaction with
  • enclaveKey: Orion public key
  • participants: list of enclaveKey to pass to the contract to add to the group
Returns:
Type
Promise.<(AxiosResponse.<any>|never)>

(inner) findOnChainPrivacyGroup(options)

Source:

Find privacy groups

Parameters:
Name Type Description
options

Map to find the group options map can contain the following:

  • addresses: the members of the privacy group
Returns:

Promise<privacy group | never>

(inner) findPrivacyGroup(options)

Source:

Find privacy groups

Parameters:
Name Type Description
options

Options passed into findPrivacyGroup

  • options.addresses
Returns:

Promise<transaction count | never>

(inner) genericSendRawTransaction(options, method)

Source:

Send a transaction to eea_sendRawTransaction or priv_distributeRawTransaction

Parameters:
Name Type Description
options

Used to create the private transaction

  • options.privateKey
  • options.privateFrom
  • options.privacyGroupId
  • options.privateFor
  • options.nonce
  • options.gasPrice default value 0
  • options.gasLimit default value 3000000
  • options.to
  • options.data
method

Name of the method of the transaction to call.

(inner) getTransactionReceipt(txHash, enclavePublicKey, retries, delay) → {Promise.<(AxiosResponse.<any>|never)>}

Source:

Get the private transaction Receipt.

Parameters:
Name Type Default Description
txHash string

Transaction Hash of the marker transaction

enclavePublicKey string

Public key used to start-up the Enclave

retries int 300

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

delay int 1000

The delay between the retries

Returns:
Type
Promise.<(AxiosResponse.<any>|never)>

(inner) removeFromPrivacyGroup(options) → {Promise.<(AxiosResponse.<any>|never)>}

Source:

Remove a member from an on-chain privacy group

Parameters:
Name Type Description
options

Map to add the members options map can contain the following:

  • privacyGroupId: Privacy group ID to add to
  • privateKey: Private Key used to sign transaction with
  • enclaveKey: Orion public key
  • participant: single enclaveKey to pass to the contract to add to the group
Returns:
Type
Promise.<(AxiosResponse.<any>|never)>

(inner) sendRawTransaction(options) → {Promise.<(AxiosResponse.<any>|never)>}

Source:

Send the Raw transaction to the Besu node

Parameters:
Name Type Description
options

Map to send a raw transaction to besu options map can contain the following:

  • privateKey : Private Key used to sign transaction with
  • privateFrom : Enclave public key
  • privateFor : Enclave keys to send the transaction to
  • privacyGroupId : Enclave id representing the receivers of the transaction
  • nonce(Optional) : If not provided, will be calculated using eea_getTransctionCount
  • to : The address to send the transaction
  • data : Data to be sent in the transaction
Returns:
Type
Promise.<(AxiosResponse.<any>|never)>

(inner) setPrivacyGroupLockState(options) → {Promise.<(AxiosResponse.<any>|never)>}

Source:

Either lock or unlock the privacy group for member adding

Parameters:
Name Type Description
options

Map to lock the group options map can contain the following:

  • privacyGroupId: Privacy group ID to lock/unlock
  • privateKey: Private Key used to sign transaction with
  • enclaveKey: Orion public key
  • lock: boolean indicating whether to lock or unlock
Returns:
Type
Promise.<(AxiosResponse.<any>|never)>

(async, inner) subscribe(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