Skip to content

Commit

Permalink
Merge pull request #62 from GetScatter/master
Browse files Browse the repository at this point in the history
Better mobile support, and updating eosio libs for faster signing and fixes for node issues
  • Loading branch information
nsjames authored Feb 5, 2021
2 parents a9f1f00 + 8f29d68 commit d9db4d2
Show file tree
Hide file tree
Showing 12 changed files with 6,254 additions and 6,028 deletions.
12,054 changes: 6,090 additions & 5,964 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
},
"dependencies": {
"@veriff/js-sdk": "^1.0.0",
"@walletpack/bitcoin": "^1.0.55",
"@walletpack/core": "^1.0.50",
"@walletpack/eosio": "^0.0.61",
"@walletpack/ethereum": "^0.0.60",
"@walletpack/fio": "^0.0.28",
"@walletpack/tron": "^0.0.62",
"@walletpack/bitcoin": "^1.0.56",
"@walletpack/core": "^1.0.51",
"@walletpack/eosio": "^0.0.67",
"@walletpack/ethereum": "^0.0.61",
"@walletpack/fio": "^0.0.29",
"@walletpack/tron": "^0.0.63",
"aes-oop": "^1.0.4",
"bip32": "^2.0.4",
"bip39": "^2.6.0",
Expand All @@ -49,9 +49,9 @@
"@babel/cli": "^7.5.0",
"@babel/core": "^7.5.0",
"@babel/node": "^7.5.0",
"@fortawesome/fontawesome-pro": "^5.10.1",
"@babel/preset-env": "^7.5.2",
"@babel/register": "^7.4.4",
"@fortawesome/fontawesome-pro": "^5.10.1",
"@vue/cli-plugin-babel": "^3.9.0",
"@vue/cli-service": "^3.9.0",
"chai": "^4.2.0",
Expand Down
17 changes: 15 additions & 2 deletions src/components/ManageAccounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Button v-show="!collapsedSidebar" v-tooltip="'Refresh'" small="1" :icon="`fal fa-sync ${loadingAccounts ? 'fa-spin' : ''}`" :disabled="loadingAccounts" @click.native="refreshAccounts" />
<Button v-show="!collapsedSidebar" v-tooltip="'Networks'" small="1" icon="fal fa-globe-americas" @click.native="manageNetworks" />
<Button v-show="!collapsedSidebar" v-tooltip="'Keys'" small="1" icon="fal fa-key" @click.native="manageKeys" />
<Button small="1" icon="fas fa-user" @click.native="toggleCollapsed" />
<Button v-if="!isMobile || !collapsedSidebar" small="1" icon="fas fa-user" @click.native="toggleCollapsed" />
</section>

<SearchBar placeholder="Search accounts..." v-show="!collapsedSidebar" v-on:terms="x => search = x" />
Expand Down Expand Up @@ -60,6 +60,7 @@
import BalanceService from '@walletpack/core/services/blockchain/BalanceService';
import Popups from "../util/Popups";
import PopupService from "../services/utility/PopupService";
import {RouteNames} from "../vue/Routing";
export default {
components:{
Expand Down Expand Up @@ -91,6 +92,9 @@
enabledAccounts(){
return SingularAccounts.accounts(this.networks);
},
isSettings(){
return this.$route.name === RouteNames.Settings
},
},
mounted(){
this.refreshAccounts()
Expand Down Expand Up @@ -161,6 +165,7 @@
} else {
SingularAccounts.setPredefinedAccount(network, account);
}
},
async removeAccount(account, network){
if(this.enabledAccounts.find(x => x.unique() === account.unique())){
Expand Down Expand Up @@ -211,7 +216,7 @@
width:$accountssidebar;
border-left:1px solid $borderlight;
padding:20px;
z-index:2;
z-index:3;
transition:width 0.2s ease;
Expand Down Expand Up @@ -416,4 +421,12 @@
}
}
.mobile {
.manage-accounts {
border-left: 1px solid transparent;
z-index:-1;
}
}
</style>
4 changes: 2 additions & 2 deletions src/components/NavigationBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--<router-link :to="{name:RouteNames.Dashboard}" class="item"><i class="fal fa-drafting-compass"></i> <span>Explore</span></router-link>-->
<router-link :to="{name:RouteNames.Wallet, query:{type:'assets'}}" class="item"><i class="fal fa-wallet"></i> <span>Wallet</span></router-link>
<router-link :to="{name:RouteNames.Identity}" class="item"><i class="fal fa-id-badge"></i> <span>Identity</span></router-link>
<router-link :to="{name:RouteNames.Apps}" class="item"><i class="fal fa-rocket"></i> <span>Apps</span></router-link>
<!--<router-link :to="{name:RouteNames.Apps}" class="item"><i class="fal fa-rocket"></i> <span>Apps</span></router-link>-->
<!--<router-link :to="{name:RouteNames.Socialize}" class="item"><i class="fal fa-comments"></i> <span>Socialize</span></router-link>-->
</section>
</template>
Expand All @@ -27,7 +27,7 @@
bottom:0;
left:0;
right:0;
z-index:2;
z-index:3;
box-shadow: 0 2px 10px 0 rgba(7,153,255,0.08), 0 8px 60px 0 rgba(7,153,255,0.25);
border-left:1px solid $borderlight;
border-right:1px solid $borderlight;
Expand Down
29 changes: 24 additions & 5 deletions src/components/TopActions.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<section class="top-actions">
<section class="visible-bar" :class="{'active':loadingBalances}" :style="{'color':topActionsColor}">
<section class="balance" v-if="!isMobile">
<span class="number">{{currency}}<AnimatedNumber :number="totalBalance" /></span>
<section class="balance" v-if="!isSettings" :class="{'wallet':isWallet}">
<span class="number" v-if="!isMobile">{{currency}}<AnimatedNumber :number="totalBalance" /></span>
<span class="refresh" :class="{'loading':loadingBalances}" @click="refreshBalances">
<i class="fas fa-sync-alt" :class="{'animate-spin':loadingBalances}"></i>
<span v-if="!loadingBalances">Refresh Balances</span>
<span v-if="loadingBalances">Refreshing</span>
<span v-if="!isMobile && !loadingBalances">Refresh Balances</span>
<span v-if="!isMobile && loadingBalances">Refreshing</span>
</span>
</section>
<section>
Expand All @@ -15,7 +15,7 @@
<span v-if="!isSettings">Settings</span>
<span v-if="isSettings">Back</span>
</figure>
<figure v-if="isMobile" @click="toggleCollapsed" class="icon">
<figure v-if="isMobile && !isSettings" @click="toggleCollapsed" class="icon">
<i class="fas fa-user"></i>
</figure>
<!--<figure @click="selectAccount" class="icon"><i class="fal fa-user"></i><span>Accounts</span></figure>-->
Expand Down Expand Up @@ -110,6 +110,9 @@
isSettings(){
return this.$route.name === RouteNames.Settings
},
isWallet(){
return this.$route.name === RouteNames.Wallet
},
usingIdentity(){
return this.scatter.keychain.identities[0].ridl.toString().indexOf('::') > -1;
},
Expand Down Expand Up @@ -488,6 +491,22 @@
}
}
}
.balance {
&.wallet {
.number {
top:-20px;
opacity:0;
}
.refresh {
top:20px;
opacity:1;
i {
font-size: 22px;
}
}
}
}
}
}
}
Expand Down
38 changes: 36 additions & 2 deletions src/components/popups/ExportPrivateKey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
<Input disabled="1" :text="privateKey" />
<Button v-tooltip="`Copy key`" icon="fas fa-copy" @click.native="copyKey" />
</section>

<section class="qr">
<img v-if="qr" :src="qr" />
<div v-else>
<i class="animate-spin fas fa-spinner"></i>
</div>
</section>
</section>


Expand All @@ -30,17 +37,20 @@
import {blockchainName} from '@walletpack/core/models/Blockchains'
import Popups from "../../util/Popups";
import PopupService from "../../services/utility/PopupService";
import QRService from "../../services/utility/QRService";
export default {
props:['popin', 'closer'],
data(){return {
privateKey:null,
qr:null,
}},
created(){
async created(){
if(window.wallet){
window.wallet.getPrivateKey(this.keypair.id, this.keypair.blockchains[0]).then(privateKey => {
window.wallet.getPrivateKey(this.keypair.id, this.keypair.blockchains[0]).then(async privateKey => {
if(!privateKey) this.closer(null);
this.privateKey = privateKey;
this.qr = await QRService.createQR(privateKey);
})
}
},
Expand All @@ -67,6 +77,30 @@
width:calc(100% - 80px);
margin:0 auto;
$qr:120px;
.qr {
display:inline-block;
height:$qr;
width:$qr;
background:red;
img {
height:$qr;
width:$qr;
}
div {
height:$qr;
width:$qr;
font-size: 48px;
display:flex;
justify-content: center;
align-items: center;
margin:0 auto;
color:$grey;
}
}
.sub-title {
background:$red;
padding:5px 10px;
Expand Down
12 changes: 11 additions & 1 deletion src/components/popups/ManageKeys.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<br>

<Button text="Generate New Key" style="margin-bottom:5px;" primary="1" @click.native="generateKey" />
<Button text="Import From QR" @click.native="importQR" />
<Button v-if="canUseHardware" text="Import From Hardware" primary="1" @click.native="importingHardware = true" />
</section>

Expand Down Expand Up @@ -69,7 +70,7 @@
<Button v-if="!key.external" v-tooltip="`Convert blockchains`" icon="fal fa-link" @click.native="convertKeypair(key)" />
<Button v-if="detachedKey(key)" icon="fal fa-ban" v-tooltip="`Remove key`" @click.native="removeKey(key)" />
<Button v-if="canManuallyLink(key)" icon="fal fa-user" v-tooltip="`Manually link account`" @click.native="manuallyLinkAccount(key)" />
<Button primary="1" v-if="!key.external" text="Export" icon="fal fa-key" @click.native="exportKey(key)" />
<Button style="flex:0 0 auto;" primary="1" v-if="!key.external" text="Export" icon="fal fa-key" @click.native="exportKey(key)" />
</section>

</section>
Expand Down Expand Up @@ -155,6 +156,8 @@
...mapState([
'scatter',
'accountCache',
'isMobile',
'isMobileDevice',
]),
importing(){
return this.popin.data.props.importing
Expand Down Expand Up @@ -206,6 +209,13 @@
this.importingHardware = false;
}
},
async importQR(){
PopupService.push(Popups.scanQR(key => {
if(!key) return;
this.privateKey = key;
this.checkTextKey();
}));
},
async generateKey(){
const keypair = Keypair.placeholder();
keypair.blockchains = [this.blockchain];
Expand Down
13 changes: 10 additions & 3 deletions src/components/wallet/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,11 @@
opacity:0;
display:flex;
align-items: center;
height:100%;
top:0;
bottom:0;
right:0;
transform:translateX(50px);
height:100%;
top:0;
button {
margin-left:5px;
Expand Down Expand Up @@ -757,6 +757,7 @@
&:focus {
.balance {
opacity:1;
transform:translateX(0px);
}
}
}
Expand Down Expand Up @@ -785,17 +786,23 @@
flex-direction:row;
justify-content:stretch;
transform:translateX(0px);
height:auto;
top:auto;
button {
flex-grow:1;
margin:0;
border:0;
border-radius:0;
&:last-child {
border-bottom-right-radius:4px;
}
}
}
.balance {
font-size: $font-size-large;
font-size: $font-size-medium;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/utility/SingletonService.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class SingletonService {
WebsocketAPIService.getApps();

// Allows free CPU for EOS Mainnet
EosioHelpers.apiPayingEosio();
// EosioHelpers.apiPayingEosio();



Expand Down
4 changes: 3 additions & 1 deletion src/util/WalletTalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ export default class WalletTalk {
changePassword:async () => true,
hardwareTypes:async () => [],
hardwareKeys:() => [],
getPrivateKey:() => null,
getPrivateKey:async () => {
return '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3';
},
sign:() => 'tester',
encrypt:() => null,
decrypt:() => null,
Expand Down
2 changes: 2 additions & 0 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@
}
.settings {
position: relative;
z-index:10;
.loading-networks {
margin-top:20px;
Expand Down
Loading

0 comments on commit d9db4d2

Please sign in to comment.