NULS Bridge is Browser extension that supports NULS Blockchain and this extension is for NULS enabled distributed application or Dapps in your browser! The Extension injects NULS API into every website's javascript context, so that dapps can read from the blockchain.
- Account Management
- Wallet Docking with Web DApp Applications
- Main & Test Network Wallets
if (typeof window.bridge !== 'undefined') {
console.log('Bridge is installed!');
}
await bridge.enable();
await bridge.isConnected();
// Output = true or false
var wallet = await bridge.getDefaultWallet();
console.log("Default Address ---> "+ wallet.address);
console.log("Default Chain ---> "+ wallet.chain_id);
await bridge.switchAccount();
await bridge.getBalance(address="tNULSeBaMhmHrnX4XJHbZxR4ypRun52s1uYnJB", chainid=2, assetChainId=2);
await bridge.getTokenBalance(address="tNULSeBaMhmHrnX4XJHbZxR4ypRun52s1uYnJB", chainid=2, "tNULSeBaNBWvMJc6RxtwabsDux3mgPjEKtb3Lm");
let wallet = await bridge.getDefaultWallet();
var inputs = {
"contractAddress": "tNULSeBaN2TLFuecRgASzC7KdbfjhbGD9MthHQ",
"methodName": "issue",
"args": ["WERTYUI123456"],
"value":0,
"sender": wallet.address,
"chainid": wallet.chain_id
};
txHash = await bridge.contractWrite(inputs);
// Output Tansaction Hash
var callargs = {
"contractAddress": "tNULSeBaN2TLFuecRgASzC7KdbfjhbGD9MthHQ",
"methodName": "isIssued",
"args": ["WERTYUI123456"],
"chainid": 2
};
output = await bridge.contractCall(callargs);
// Output Contract function return value
output = await bridge.disable();
// Removes Authentication to NULS Bridge
Rohan Ashik
- Website: www.rohanashik.co
- Twitter: @rohanashik
- GitHub: @rohanashik
- LinkedIn: @rohanashik
- Telegram: https://t.me/rohanashik
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a β if this project helped you!
NULS Wallet Address: NULSd6HgTwme2QGaSuJM75XpzfHm5ju33ZCuc
Copyright Β© 2020 Rohan Ashik.
This project is MIT licensed.