vechain / connex.driver-nodejs

Has been moved to https://github.com/vechain/connex/tree/master/packages/driver
GNU Lesser General Public License v3.0
3 stars 2 forks source link

connex driver Instance Issue #6

Closed blockchain-app12 closed 4 years ago

blockchain-app12 commented 4 years ago

sample code: var Framework = require('@vechain/connex-framework') var Driver, SimpleNet, SimpleWallet, options = require('@vechain/connex.driver-nodejs') const wallet = new SimpleWallet() wallet.import('.........') // here imported my testnet account private key const driver = await Driver.connect(new SimpleNet('http://localhost:8669/'), wallet) const connex = new Framework(driver) // here get connex object ready to use console.log(connex);
driver.txParams.expiration = 18 driver.txParams.gasPriceCoef = 128 driver.onTxCommit = txObj => { // }

Followed steps I install all the modules. I set the my testnet account private key. I also tested in Vechain testnet also "https://sync-testnet.vechain.org".

Issue faced in above source code: const wallet = new SimpleWallet() ^ TypeError: SimpleWallet is not a constructor

Kindly let me know, if I was missed anything, or any other procedure to follow.If anyone know,kindly help me

libotony commented 4 years ago

Import the modules in the following way:

const { Driver, SimpleNet, SimpleWallet, options } = require('@vechain/connex.driver-nodejs')
const wallt = new SimpleWallet()
blockchain-app12 commented 4 years ago

It's resolved. Thanks.