Supported Wallet

Supported Wallet

This topic describes how to install and use any custodial wallet that supported the Hepton PoS, but for this one, we will take Metamask as an example. You can use Metamask to create an address and complete transactions, mint NFTs, view and manage assets on the Hepton network, and connect with blockchain dApps on Web3.

Metamask Wallet Features

You can learn more about Metamask here. In this docs, we will only brief the important functions of Metamask:

You can use Metamask Wallet to:

  • Mint NFTs

  • Transfer coins and NFTs to another address

  • View your coins, tokens, and NFTs

  • View recent transactions

  • Auto split/merge coins to the exact transfer amount

  • Easily access transaction history in the Hepton Explorer

Other Wallet

Formatic Whether you already have a dApp that is integrated with web3 or are starting from scratch, Fortmatic SDK enables you to simply integrate your app with the Ethereum blockchain. Fortmatic offers a seamless and enjoyable experience for both you and the users of your app.

Install NPM Package

$ npm i --save fortmatic@latest

Example

import Fortmatic from 'fortmatic';
import Web3 from 'web3';

const customNodeOptions = {
    rpcUrl: 'https://test.hepton.io', // your own node url
    chainId: 404 // chainId of your own node
}

// Setting network to localhost blockchain
const fm = new Fortmatic('YOUR_TEST_API_KEY', customNodeOptions);
window.web3 = new Web3(fm.getProvider());

Portis

A web-based wallet called Portis was created with simple user onboarding in mind. It includes a Javascript SDK that combines with the DApp and gives the user a local wallet-free experience. Additionally, it manages wallet setup, transactions, and gas surcharges. It is non-custodial, similar to Metamask; users maintain ownership over their keys, which Portis merely safely stores. However, it is embedded within the application rather than the browser, unlike Metamask. Users' keys are connected to their login information and passwords.

1/ Web3 Setup Install NPM on dApps

npm install --save @portis/web3

Register your dApps to Portis in order to get the dApp ID Import 'Portis' and your 'Web3' Object

import Portis from '@portis/web3';
import Web3 from 'web3';

The dApp ID—which we obtained from the previous step—and the network you want to connect to are the first and second arguments, respectively, of the Portis function Object() { [native code] }. This might be a string or another kind of object.

const portis = new Portis('YOUR_DAPP_ID', 'HeptonTestnet');
const web3 = new Web3(portis.provider);

2/ Set up Account

The connected account should be successfully returned if web3's installation and instantiation were successful.

this.web3.eth.getAccounts()
.then((accounts) => {
  this.account = accounts[0];
})

3/ Contract Instantiation

const myContractInstance = new this.web3.eth.Contract(myContractAbi, myContractAddress)

4/ Calling Function

this.myContractInstance.methods.myMethod(myParams)
.call()
.then (
  // do stuff with returned values
)
this.myContractInstance.methods.myMethod(myParams)
.send({
  from: this.account,gasPrice: 0
})
.then ((receipt) => {
  // returns a transaction receipt
})

Follow our Twitter to get instant and real-time updates. Follow now: Twitter

Last updated