@@ -32,12 +32,11 @@ export default class CFDAPI {
32
32
* @param config Configuration object with all properties as per
33
33
* config.json.template
34
34
* @param web3 Initiated and connected web3 instance
35
- * @param privateKey (optional) The private key used to sign the transactions when using Infura (needed only for the daemon)
36
35
*
37
36
* @return Constructed and initialised instance of this class
38
37
*/
39
- static async newInstance ( config , web3 , privateKey ) {
40
- const api = new CFDAPI ( config , web3 , privateKey )
38
+ static async newInstance ( config , web3 ) {
39
+ const api = new CFDAPI ( config , web3 )
41
40
await api . initialise ( )
42
41
return api
43
42
}
@@ -483,30 +482,6 @@ export default class CFDAPI {
483
482
throw new Error ( error )
484
483
} )
485
484
}
486
- /**
487
- * Check for liquidation with a signed transaction (for the daemon)
488
- * @param cfdAddress, Address of the contract
489
- */
490
- attemptContractLiquidationDaemon ( cfdAddress ) {
491
- const self = this
492
- return Promise . all ( [ this . web3 . eth . getCodeAsync ( cfdAddress ) ] )
493
- . then ( ( ) => {
494
- // Contract address exists
495
- const cfd = getContract ( cfdAddress , self . web3 )
496
- return signAndSendTransaction (
497
- self . web3 ,
498
- self . config . daemonAccountAddr ,
499
- self . privateKey ,
500
- cfdAddress ,
501
- cfd . methods . liquidate ( ) . encodeABI ( ) ,
502
- self . config . gasPrice ,
503
- 500000
504
- )
505
- } )
506
- . catch ( error => {
507
- throw new Error ( error )
508
- } )
509
- }
510
485
511
486
/**
512
487
* Fulfill a request to change the sale price for a CFD for sale
@@ -925,12 +900,10 @@ export default class CFDAPI {
925
900
*
926
901
* @param config Configuration object with all properties as per config.json.template
927
902
* @param web3 Initiated web3 instance for the network to work with.
928
- * @param privateKey (optional) The private key used to sign the transactions (for using Infura for example)
929
903
*/
930
- constructor ( config , web3 , privateKey = undefined ) {
904
+ constructor ( config , web3 ) {
931
905
this . config = config
932
906
this . web3 = web3
933
- this . privateKey = privateKey
934
907
this . web3 . eth . getCodeAsync = Promise . promisify ( this . web3 . eth . getCode )
935
908
this . web3 . eth . getBlockAsync = Promise . promisify ( this . web3 . eth . getBlock )
936
909
}
0 commit comments