This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "abi": [ | |
| { | |
| "constant": false, | |
| "inputs": [ | |
| { | |
| "name": "x", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "set", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.5.0; | |
| contract SimpleStorage { | |
| uint256 storedData; | |
| function set(uint256 x) public { | |
| storedData = x; | |
| } | |
| function get() public view returns (uint256) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const transactionObject = { | |
| from: 'source-account-address', | |
| to: 'destination-account-address', | |
| value: web3.utils.toWei('1', 'ether'), | |
| }; | |
| await web3.eth.sendTransaction(transactionObject); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const currentBalance = await web3.eth.getBalance('account-address'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Web3 from 'web3'; | |
| const provider = new Web3.providers.HttpProvider( | |
| 'http://127.0.0.1:8545', | |
| ); | |
| const web3 = new Web3(provider); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
| ✅ did:muport:QmdE65oF2PsfbwZp4Ryw6KxEU7sMDGifbzygXxwHnRzevu ✅ | |
| Create your profile today to start building social connection and trust online at https://3Box.io/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.get('/unicorn', (req, res) => { | |
| credentials.createDisclosureRequest({ | |
| verified: ['Identity'], | |
| notifications: true, | |
| callbackUrl: endpoint + '/callback_unicorn' | |
| }).then(requestToken => { | |
| console.log('decoded jwt', decodeJWT(requestToken)) //log request token to console | |
| const uri = message.paramsToQueryString(message.messageToURI(requestToken), { callback_type: 'post' }) | |
| const qr = transports.ui.getImageDataURI(uri) | |
| res.send(`<div><img src="${qr}"/></div>`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express') | |
| const bodyParser = require('body-parser') | |
| const ngrok = require('ngrok') | |
| const decodeJWT = require('did-jwt').decodeJWT | |
| const { Credentials } = require('uport-credentials') | |
| const transports = require('uport-transports').transport | |
| const message = require('uport-transports').message.util | |
| let endpoint = '' | |
| const app = express(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Credentials credentials; | |
| try { | |
| List<String> lines = Files.readAllLines(walletPathFile); | |
| credentials = WalletUtils.loadCredentials(walletPassword, new File(lines.get(0))); | |
| } catch (IOException e) { | |
| String walletFile = WalletUtils.generateLightNewWalletFile( | |
| walletPassword, new File(WalletUtils.getDefaultKeyDirectory()) | |
| ); | |
| String walletFilePath = WalletUtils.getDefaultKeyDirectory() + "/" + walletFile; | |
| credentials = WalletUtils.loadCredentials(walletPassword, walletFilePath); |