@mutopad/connex
TypeScript icon, indicating that this package has built-in type declarations

0.0.42 • Public • Published

Connex

npm version

The out of the box Connex implementation for browser.

Installation

Include in <script> tag

Just include the CDN link within a script tag. Connex will then be registered as a global variable.

<!-- install the latest v2 -->
<script src="https://unpkg.com/@mutopad/connex@2" />

NPM

It's recommended when your project is a bit large.

npm i @mutopad/connex
import Connex from '@mutopad/connex'

Startup

Create a Connex object connects to VeChain mainnet

const connex = new Connex({
    node: 'https://mainnet.veblocks.net/', // veblocks public node, use your own if needed
    network: 'main' // defaults to mainnet, so it can be omitted here
})

Connect to testnet

const connex = new Connex({
    node: 'https://testnet.veblocks.net/',
    network: 'test'
})

Or connect to private network

const connex = new Connex({
    node: '<the API url of your node>',
    // the genesis block of your private network
    network: {
        id: '0x...',
        ...
    }
})

Create Vendor module only

In some cases, e.g. the classic 'Buy me a coffee' demo, you don't need the ability to access the blockchain. You can opt-out Connex.Thor module, and just create Connex.Vendor module.

const vendor = new Connex.Vendor('main') //'main','test' or genesis ID if it's private network

Using in Node.js environment

This package, @mutopad/connex is designed only work in the browser, if you are interested in running it in Node.js, try @mutopad/connex-framework.

License

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.421latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.421
0.0.411
0.0.401
0.0.391
0.0.381
0.0.371
0.0.361
0.0.351
0.0.341
0.0.331
0.0.321
0.0.311
0.0.301
0.0.291
0.0.281
0.0.271
0.0.261
0.0.251
0.0.241
0.0.231
0.0.221
0.0.211
0.0.201
0.0.191
0.0.181
0.0.171
0.0.161
0.0.151
0.0.141
0.0.131
0.0.121
0.0.111
0.0.100
0.0.91
0.0.80
0.0.71
0.0.61
0.0.51
0.0.41
0.0.31
0.0.11

Package Sidebar

Install

npm i @mutopad/connex

Weekly Downloads

39

Version

0.0.42

License

LGPL-3.0

Unpacked Size

2.75 MB

Total Files

18

Last publish

Collaborators

  • mutopad