You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to Quorum documentation https://docs.goquorum.com/en/latest/Getting%20Started/api/, in order to support private transactions the web3.eth.sendTransaction(object) API method has been modified by adding the two following parameters to the transaction object:
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.
privateFor: List - (optional) When sending a private transaction, an array of the recipients’ base64-encoded public keys.
Actual behavior
I am doing a Quorum project using React and Typescript, and wen I use the web3.eth.sendTransaction method with those two new parameters I get the following error:
Argument of type '{ from: string; to: string; gasPrice: number; data: string; privateFrom: string; privateFor: string[]; }' is not assignable to parameter of type 'TransactionConfig'. Object literal may only specify known properties, and 'privateFrom' does not exist in type 'TransactionConfig'.
Solution proposal
In order to tackle this problem, I changed in (my node_modules folder) the TransactionConfig interface which you can find in file index.d.ts in web3-core/types folder, into this one (just added the two optional parameters privateFrom and privateFor):
@MarcoMazzoni Thanks for opening this issue! Because the mentioned properties do not exist in the web3.js library do we recommend to use the extend method with a custom input and output formatter and your own type definitions.
According to Quorum documentation https://docs.goquorum.com/en/latest/Getting%20Started/api/, in order to support private transactions the
web3.eth.sendTransaction(object)
API method has been modified by adding the two following parameters to the transaction object:Actual behavior
I am doing a Quorum project using React and Typescript, and wen I use the web3.eth.sendTransaction method with those two new parameters I get the following error:
Argument of type '{ from: string; to: string; gasPrice: number; data: string; privateFrom: string; privateFor: string[]; }' is not assignable to parameter of type 'TransactionConfig'. Object literal may only specify known properties, and 'privateFrom' does not exist in type 'TransactionConfig'.
Solution proposal
In order to tackle this problem, I changed in (my node_modules folder) the TransactionConfig interface which you can find in file index.d.ts in web3-core/types folder, into this one (just added the two optional parameters
privateFrom
andprivateFor
):I tested it into my project, and now the private transaction is working.
Could you please add those two optional params to the TransactionConfig interface?
Thank you very much for your help.
Versions
[NPM 6.12.0, Node 12.13.0, Web3.js 1.2.4, OS: Linux 18.04]
The text was updated successfully, but these errors were encountered: