Ui 2 provider rename (web3Provider -> ethereum) (#6031)
* Rename web3Provider -> ethereumProvider * ethereumProvider -> ethereum
This commit is contained in:
parent
699aab0b80
commit
4dd68f1ef3
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
api
|
api
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
import Web3 from 'web3';
|
import Web3 from 'web3';
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
let web3;
|
let web3;
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
function trackRequest (signerRequestId, statusCallback) {
|
function trackRequest (signerRequestId, statusCallback) {
|
||||||
return api.pollMethod('parity_checkRequest', signerRequestId)
|
return api.pollMethod('parity_checkRequest', signerRequestId)
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
api
|
api
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
api
|
api
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
const { bytesToHex, sha3, toWei, fromWei } = api.util;
|
const { bytesToHex, sha3, toWei, fromWei } = api.util;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
api
|
api
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
api
|
api
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
api
|
api
|
||||||
|
@ -23,11 +23,11 @@ import Api from './api';
|
|||||||
|
|
||||||
import './dev.parity.html';
|
import './dev.parity.html';
|
||||||
|
|
||||||
const web3Provider = new Api.Provider.Http('/rpc/');
|
const ethereumProvider = new Api.Provider.Http('/rpc/');
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
window.parity = {
|
window.parity = {
|
||||||
Api,
|
Api,
|
||||||
api,
|
api,
|
||||||
web3Provider
|
ethereumProvider
|
||||||
};
|
};
|
||||||
|
@ -79,7 +79,7 @@ const dappsHistory = HistoryStore.get('dapps');
|
|||||||
function onEnterDapp ({ params: { id } }) {
|
function onEnterDapp ({ params: { id } }) {
|
||||||
const token = DappMethodsStore.get().createToken(id);
|
const token = DappMethodsStore.get().createToken(id);
|
||||||
|
|
||||||
window.web3Provider = new Api.Provider.PostMessage(token, window);
|
window.ethereum = new Api.Provider.PostMessage(token, window);
|
||||||
|
|
||||||
if (!dapps[id] || !dapps[id].skipHistory) {
|
if (!dapps[id] || !dapps[id].skipHistory) {
|
||||||
dappsHistory.add(id);
|
dappsHistory.add(id);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
|
|
||||||
export default new Api(web3Provider);
|
export default new Api(ethereumProvider);
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
import Api from '@parity/api';
|
import Api from '@parity/api';
|
||||||
|
|
||||||
const web3Provider = (window.parity && window.parity.web3Provider) || (window.parent && window.parent.web3Provider);
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
||||||
const api = new Api(web3Provider);
|
const api = new Api(ethereumProvider);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
api
|
api
|
||||||
|
Loading…
Reference in New Issue
Block a user