a1b8fabd99
* Ensure all internal dapps have package.json * Update compilation rules # Conflicts: # js/src/redux/providers/balancesActions.js # js/src/ui/Form/TypedInput/typedInput.js * Remove SignerIcon * Cleanup providers * Enable request of new token from app * Queue when no token (yet) * Add location & token request * Cleanup send logic * Request token * Request comms token * Remove yarn.lock (not updated) * Update version to 1.99.99 (publish prepare) * Move jsonrpc to seperate repo * Update jsonrpc references * Update repo info * Update repo info * Additional debugging * Update repo references * Move ABI to js-abi repo * Move webWorker to shared * Fix package reference * Worker location * Move js-ui & js-shared components * Update file references * Update package repo locations * Remove debugging info * Cleanup debug * Split api into own repo * Update api local references * Update app loading * Update dependencies * Allow serving of /parity-utils * Error when EthereumProvider has not been attached * Use inject.js * Correct appId retrieval
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
|
|
// This file is part of Parity.
|
|
|
|
// Parity is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// Parity is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
import Api from '@parity/api';
|
|
|
|
const ethereumProvider = window.ethereum || window.parent.ethereum;
|
|
|
|
if (!ethereumProvider) {
|
|
throw new Error('Unable to locate EthereumProvider, object not attached');
|
|
}
|
|
|
|
const api = new Api(ethereumProvider);
|
|
const { bytesToHex, sha3, toWei, fromWei } = api.util;
|
|
|
|
export {
|
|
api,
|
|
bytesToHex, sha3, toWei, fromWei
|
|
};
|