Connex is the standard interface to connect DApp with VeChain and user. Connex
is a set of well-designed APIs for developers, with injected Connex Object
in web applications they can easily build decentralized applications.
Sync or other compatible clients will expose connex
API by an injected object on Window Object
.
npm install @vechain/connex --save-dev
Add @vechain/connex
to compilerOptions.types
in tsconfig.json
then you are good to go!
No need to set up, just code in your favourite way.
const el = document.createElement('h1')
if(window.connex){
const status = connex.thor.status
el.innerText = 'You are \'connexed\' to vechain, the status is ' + (status.progress === 1 ? 'synced': 'syncing')
}else{
el.innerText = ':( seems you don\'t have enough component to launch this app, please ......'
}
document.querySelector('body').append(el)
- API Reference for DApp developers
Connex is licensed under the GNU Lesser General Public License v3.0, also included in LICENSE file in the repository.