This file contains 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
""" | |
NEX ICO Template | |
=================================== | |
Author: Thomas Saunders | |
Email: tom@neonexchange.org | |
Date: Dec 11 2017 | |
""" |
This file contains 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
// Workable on Mainnet: | |
// https://kyber.network/swap/eth_knc | |
// https://dapp.originprotocol.com | |
var Web3 = require('web3'); | |
const ProviderEngine = require('web3-provider-engine') | |
const RpcSubprovider = require('web3-provider-engine/subproviders/rpc.js') | |
const Web3Subprovider = require("./web3_subprovider.js"); | |
const DappSubprovider = require("./dapp_subprovider_new.js"); |
This file contains 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
{ | |
"name": "webView", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "npm react-native start", | |
"test": "jest", | |
"postinstall": "./node_modules/.bin/rn-nodeify --install --hack", | |
"debug": "open 'rndebugger://set-debugger-loc?host=localhost&port=8081'" | |
}, |
This file contains 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 result = await window.web3.eth.personal.sign( | |
'Hello world!', // The Message | |
'0x33b8287511ac7F003902e83D642Be4603afCd876', // User Account | |
'', // Password | |
); | |
// Response: Signed Result | |
'0x0d9273c44a7371c149efb68b100b6aaaf229e8a5502249d84e3febe17f133f7b201b9c3087f507eee684c9a97d08681de5ef1ca8738d26eb5daf63b9adcf69da1b' |
This file contains 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 account = window.web3.eth.defaultAccount; | |
// Response: User's default Ethereum account | |
'0x33b8287511ac7F003902e83D642Be4603afCd876' |
This file contains 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 result = await window.web3.eth.sendTransaction({ | |
from: '0x33b8287511ac7F003902e83D642Be4603afCd876', | |
to: '0x9EE2B16e1FA35E417dB7dE2fDd9377a73D7c2B67', | |
value: '1000000000000000', // 0.0001 ETH in Wei | |
gas: 21000, // Gas Amount | |
}); | |
// Response: Transaction ID (Hash) | |
'0x3d5ccbe71ace8cbdb63ee210a8121a95120231a976c82eaf9ba948de119c4586' |
This file contains 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
<script src='https://storage.googleapis.com/dappsdk/dapp-sdk.bundle.js'></script> |
This file contains 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
await window.ethereum.enable(); |
This file contains 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
await window.ethereum.logout(); |
This file contains 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
// Dapp SDK | |
window.ethereum.isDappSdk | |
> True | |
window.ethereum.dappSdk.version | |
> "0.1.0" | |
// MetaMask | |
window.ethereum.isMetaMask | |
> True |