If you already support Web3-technology, you can improve the UX within your application by integrating the Arkane Web3 provider, a smart wrapper around the existing Web3 Ethereum JavaScript API.
By making use of our Web3 provider you are able to leverage the full potential of Arkane with minimal effort and you will be able to onboard users that are less tech-savvy without making them leave your application or download third-party plugins. Integrating just takes 2 steps and 5 minutes.
Don't worry we've got you covered with our 📦 Widget - Arkane Connect.
Install the library by downloading it to your project via NPM
npm i @arkane-network/web3-arkane-provider
followed by adding the script to the head of your page.
<script src="/node_modules/@arkane-network/web3-arkane-provider/dist/web3-arkane-provider.js"></script>
After adding the javascript file to your page, a global Arkane object is added to your window. This object is the gateway for creating the web3 wrapper and fully integrates the widget - Arkane Connect.
Add the following lines of code to your project, it will load the Arkane web3 provider.
Arkane.createArkaneProviderEngine({clientId: 'Arketype'}).then(provider => {web3 = new Web3(provider);});
const options = {clientId: 'Arketype',rpcUrl: 'https://kovan.infura.io/v3/YOUR-PROJECT-ID', //optionalenvironment: 'staging', //optional, production by defaultsignMethod: 'POPUP', //optional, REDIRECT by defaultbearerTokenProvider: () => 'obtained_bearer_token', //optional, default undefined//optional: you can set an identity provider to be used when authenticatingauthenticationOptions: {idpHint: 'google'},secretType: 'ETHEREUM' //optional, ETHEREUM by default};Arkane.createArkaneProviderEngine(options).then(provider => {web3 = new Web3(provider);});
The web3 instance now works as if it was injected by parity or metamask. You can fetch wallets, sign transactions, and messages.
🧙 To connect to our production environment and mainnet, you will need to register your app and request your Client ID.
If you want to use the web3js event emitter, please use version >= 1.3.0 of web3js.