Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Meta mask integr #508

Open
wants to merge 68 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f71fd5d
Merge pull request #477 from ethereum/develop
evertonfraga May 23, 2018
7ae5dfb
Move babel/@runtime to dependencies
ryanio Jun 4, 2018
1eeac1b
Update version
ryanio Jun 4, 2018
b615a48
Improving environment detection; removing yarn.lock; adding npm run b…
evertonfraga Jun 5, 2018
6155c56
Merge pull request #478 from ethereum/babelruntime
evertonfraga Jun 5, 2018
96c3a42
Merge branch 'master' of github.com:ethereum/meteor-dapp-wallet into …
evertonfraga Jun 5, 2018
663ef16
package-lock.json
evertonfraga Jun 5, 2018
e24d201
Using npm run
evertonfraga Jun 5, 2018
0023712
Adding circleci file
evertonfraga Jun 5, 2018
2886f69
Merge pull request #479 from ethereum/mist-mode-helpers
evertonfraga Jun 5, 2018
041a500
Update README.md
ryanio Jun 5, 2018
091939c
Indent
ryanio Jun 5, 2018
68006f7
Add colon
ryanio Jun 5, 2018
39f7768
Adding dependency of ecmascript
evertonfraga Jun 5, 2018
0e08054
Building on circleci
evertonfraga Jun 5, 2018
b0991c1
Building on circleci
evertonfraga Jun 5, 2018
80d67bf
Merge pull request #481 from ethereum/add-core-js
evertonfraga Jun 6, 2018
2163f6a
CI config
evertonfraga Jun 13, 2018
7b41a2f
CI config
evertonfraga Jun 13, 2018
c0ffa23
Merge branch 'master' into update-readme
evertonfraga Jun 13, 2018
7964461
Fixing account button on dashboard
evertonfraga Jun 14, 2018
cbf4fce
Merge pull request #480 from ethereum/update-readme
evertonfraga Jun 14, 2018
807df06
Merge branch 'master' into fix-account-button
evertonfraga Jun 14, 2018
ed498b5
Extract refactoring
evertonfraga Jun 14, 2018
d5d2072
Merge branch 'fix-account-button' of github.com:ethereum/meteor-dapp-…
evertonfraga Jun 14, 2018
6a6463b
Merge pull request #485 from ethereum/fix-account-button
evertonfraga Jun 14, 2018
337dedb
Updating contract placeholder with constructor syntax
evertonfraga Aug 15, 2018
8d9eb00
Hide gas section if isMist, since we are now handling this inside the…
ryanio Aug 31, 2018
8262ea6
Updated contract.js for broken token list url
berkantaydin Sep 14, 2018
221c3c6
Merge pull request #494 from berkantaydin/broken-tokenListURL-fix
evertonfraga Sep 14, 2018
42dc878
Merge branch 'master' into hide-gas-for-mist
evertonfraga Sep 14, 2018
633a436
[ImgBot] optimizes images
ImgBotApp Sep 23, 2018
efb0504
Merge pull request #1 from AYIDouble/imgbot
IDouble Sep 23, 2018
305ed1a
Merge branch 'master' into update-contract-placeholder
evertonfraga Oct 4, 2018
6b36a38
Merge pull request #488 from ethereum/update-contract-placeholder
evertonfraga Oct 4, 2018
59fd709
Merge branch 'master' into hide-gas-for-mist
evertonfraga Oct 4, 2018
4b56fc6
Merge branch 'develop' into hide-gas-for-mist
evertonfraga Oct 4, 2018
aaaf261
Merge branch 'master' into master
evertonfraga Oct 5, 2018
299358b
Merge pull request #489 from ethereum/hide-gas-for-mist
ryanio Oct 5, 2018
f680c56
Merge branch 'master' into master
alexvansande Oct 8, 2018
822de4a
Merge pull request #495 from AYIDouble/master
evertonfraga Oct 9, 2018
53048e5
Remove mist warning
evertonfraga Oct 9, 2018
2d48ac4
Add meteor-build-client as devDependency
evertonfraga Oct 9, 2018
f10de4d
Wallet interface
evertonfraga Oct 9, 2018
c8d6c25
Removing CI dependency cache (deterministic CI builds) and simplifyin…
evertonfraga Oct 9, 2018
a1f2608
Fixes autoscan erroring out on invalid token address
ryanio Oct 9, 2018
f3f95bc
Build files
evertonfraga Oct 9, 2018
d93ceaf
Triggering CI job
evertonfraga Oct 9, 2018
f195893
CI: Run npm script inside app dir
evertonfraga Oct 9, 2018
17277b9
CI: Run npm script inside app dir
evertonfraga Oct 9, 2018
3e2ef07
Fixes #4032
ryanio Jul 31, 2018
0f0a6b7
Build files
evertonfraga Oct 9, 2018
f191791
CI: fix cwd
evertonfraga Oct 9, 2018
bd5b521
Import wallet owner check should consider checksum version of address
evertonfraga Oct 9, 2018
b11570f
Refactor: avoiding dense IF statements
evertonfraga Oct 10, 2018
0e24a34
Fix: always return promise
evertonfraga Oct 10, 2018
94e0b23
Prevents log checking for wallet contracts on wallet observer, as it …
evertonfraga Oct 11, 2018
05b2dca
Allows wallet to be re-added, to get out from "Creating..." state
evertonfraga Oct 11, 2018
007b535
Refactor: function extraction
evertonfraga Oct 11, 2018
8d61dbf
Workaround: dealing with both checksum and lowercase addresses
evertonfraga Oct 11, 2018
6625014
Wallet static build
evertonfraga Oct 11, 2018
0263fff
Merge pull request #496 from ethereum/remove-warning
evertonfraga Oct 11, 2018
179803e
Fixes address queries (#501)
evertonfraga Nov 16, 2018
284905f
Static files (#502)
evertonfraga Nov 16, 2018
36d5704
updated babel
frozeman Jun 15, 2020
dd68f84
fixed babel
frozeman Jun 15, 2020
2d476ae
added meta mask compatibility
frozeman Jun 15, 2020
6673b65
fixed select adn build files
frozeman Jun 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added meta mask compatibility
frozeman committed Jun 15, 2020
commit 2d476aec58fa3e5eacd290971f664dde0df3e715
3 changes: 3 additions & 0 deletions app/client/lib/ethereum/observeBlocks.js
Original file line number Diff line number Diff line change
@@ -162,6 +162,9 @@ observeLatestBlocks = function() {
updateBalances();

// GET the latest blockchain information
// setInterval(()=>{
// updateBalances();
// }, 1000 * 15);
web3.eth.subscribe('newBlockHeaders', function(e, res) {
if (!e) {
updateBalances();
8 changes: 2 additions & 6 deletions app/client/templates/views/dashboard.html
Original file line number Diff line number Diff line change
@@ -25,9 +25,7 @@ <h2>{{i18n "wallet.accounts.accountsTitle"}}</h2>
{{/each}}
</div>

{{#unless isBrowserMode}}
{{> elements_new_account_button }}
{{/unless}}
{{> elements_new_account_button }}


<h2>{{i18n "wallet.accounts.walletsTitle"}}</h2>
@@ -62,9 +60,7 @@ <h3>{{i18n "wallet.app.buttons.addWallet"}}</h3>
{{else}}
<div class="col col-5 mobile-full ">
<br>
{{#unless isBrowserMode}}
{{> elements_new_account_button }}
{{/unless}}
{{> elements_new_account_button }}
</div>
<div class="col col-5 mobile-full ">
<h3>{{i18n "wallet.app.texts.noAccounts.title"}}</h3>
70 changes: 52 additions & 18 deletions app/client/templates/views/dashboard.js
Original file line number Diff line number Diff line change
@@ -60,7 +60,8 @@ Template['views_dashboard'].helpers({
hasMinimumBalance: function() {
var enoughBalance = false;
_.each(_.pluck(EthAccounts.find({}).fetch(), 'balance'), function(bal) {
if (new BigNumber(bal, '10').gt(1000000000000000)) enoughBalance = true;
if (bal && new BigNumber(bal, '10').gt(1000000000000000))
enoughBalance = true;
});

return enoughBalance;
@@ -90,33 +91,66 @@ Template['views_dashboard'].helpers({
}
});

var insertAccounts = function(accounts) {
accounts.forEach(function(account) {
account = account.toLowerCase();
EthAccounts.upsert(
{ address: account },
{
$set: {
address: account,
new: true
}
}
);
});
};

Template['views_dashboard'].events({
/**
Request to create an account in mist

@event click .create.account
*/
'click .create.account': function(e) {
'click .create.account': async function(e) {
e.preventDefault();

mist.requestAccount(function(e, accounts) {
if (!e) {
if (!_.isArray(accounts)) {
accounts = [accounts];
if (typeof mist !== 'undefined') {
mist.requestAccount(function(e, accounts) {
if (!e) {
if (!_.isArray(accounts)) {
accounts = [accounts];
}
insertAccounts(accounts);
}
accounts.forEach(function(account) {
account = account.toLowerCase();
EthAccounts.upsert(
{ address: account },
{
$set: {
address: account,
new: true
}
});

// we assume meta mask is present
} else {
if (typeof ethereum != 'undefined') {
let accounts = await ethereum.enable();
// old meta mask way
if (Array.isArray(accounts) && accounts.length > 0) {
insertAccounts(accounts);
} else {
try {
accounts = await ethereum.send('eth_requestAccounts');
} catch (e) {}
if (Array.isArray(accounts) && accounts.length > 0) {
insertAccounts(accounts);
} else {
const web3 = new Web3(ethereum);
accounts = await web3.eth.getAccounts();
if (accounts.length > 0) {
insertAccounts(accounts);
} else {
alert(
'No accounts found! Is your browser wallet unlocked?\n\nUnlock your Browser-Wallet and reload the page.'
);
}
);
});
}
}
}
});
}
}
});