JSPM

  • Created
  • Published
  • Downloads 1706
  • Score
    100M100P100Q129335F
  • License LGPL-3.0

Connex framework driver implementation

Package Exports

  • @vechain/connex-driver
  • @vechain/connex-driver/dist/driver-no-vendor
  • @vechain/connex-driver/dist/driver-no-vendor.js
  • @vechain/connex-driver/dist/index.js
  • @vechain/connex-driver/dist/simple-net
  • @vechain/connex-driver/dist/simple-net.js
  • @vechain/connex-driver/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vechain/connex-driver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Connex Driver

npm version

This library implement Connex.Driver, which drives Connex Framework.

⚠️ Repository Notice: End-of-Life (EOL)

This repository now has reached its end-of-life (EOL). We have transitioned to brand new and comprehensive VeChain SDK that will continue to receive updates, support, and new features.

For any further questions or migration guidance, please reach out using our support portal.

Installation

# install driver along with framework
npm i @vechain/connex-framework @vechain/connex-driver

Usage

The REPL playground is a good start.

import { Framework } from '@vechain/connex-framework'
import { Driver, SimpleNet, SimpleWallet } from '@vechain/connex-driver'

const wallet = new SimpleWallet()
// add account by importing private key
wallet.import('<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
...

// config tx parameters, e.g. expiration, gasPriceCoef
driver.txParams.expiration = 18
driver.txParams.gasPriceCoef = 128
driver.txParams.maxPriorityFeePerGas = 100 // 100 Wei for tipping the miner
driver.txParams.txType = Transaction.Type.DynamicFee // txType to use

// watch committed tx
driver.onTxCommit = txObj => {
    // 
}

License

This package is licensed under the GNU Lesser General Public License v3.0, also included in LICENSE file in the repository.