Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1859 from akx20000a/node
Browse files Browse the repository at this point in the history
[Network] Add Musicoin support
  • Loading branch information
gamalielhere authored May 25, 2018
2 parents 5fdc654 + a25763a commit 813aed7
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 12 deletions.
6 changes: 0 additions & 6 deletions app/scripts/controllers/CX/addWalletCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ var addWalletCtrl = function($scope, $sce) {
case nodes.nodeTypes.ETC:
$scope.HDWallet.dPath = $scope.HDWallet.ledgerClassicPath;
break;
case nodes.nodeTypes.MUS:
$scope.HDWallet.dPath = $scope.HDWallet.ledgerMusicPath;
break;
default:
$scope.HDWallet.dPath = $scope.HDWallet.ledgerPath;
}
Expand All @@ -56,9 +53,6 @@ var addWalletCtrl = function($scope, $sce) {
case nodes.nodeTypes.ETC:
$scope.HDWallet.dPath = $scope.HDWallet.trezorClassicPath;
break;
case nodes.nodeTypes.MUS:
$scope.HDWallet.dPath = $scope.HDWallet.trezorMusicPath;
break;
case nodes.nodeTypes.Ropsten:
$scope.HDWallet.dPath = $scope.HDWallet.trezorTestnetPath;
break;
Expand Down
7 changes: 7 additions & 0 deletions app/scripts/controllers/decryptWalletCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
hwEtherGemPath: "m/44'/1987'/0'/0", // first address: m/44'/1987'/0'/0/0
hwCallistoPath: "m/44'/820'/0'/0", // first address: m/44'/820'/0'/0/0
hwSocialPath: "m/44'/1128'/0'/0", // first address: m/44'/1128'/0'/0/0
hwMusicoinPath: "m/44'/184'/0'/0", // first address: m/44'/184'/0'/0/0
singularDTVPath: "m/0'/0'/0'", // first address: m/0'/0'/0'/0
hwRskPath: "m/44'/137'/0'/0", // first address : m/44'/137'/0'/0/0
};
Expand Down Expand Up @@ -97,6 +98,9 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
case nodes.nodeTypes.ETSC:
$scope.HDWallet.dPath = $scope.HDWallet.hwSocialPath;
break;
case nodes.nodeTypes.MUSIC:
$scope.HDWallet.dPath = $scope.HDWallet.hwMusicoinPath;
break;
default:
$scope.HDWallet.dPath = $scope.HDWallet.trezorPath;
}
Expand Down Expand Up @@ -129,6 +133,9 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
case nodes.nodeTypes.ETSC:
$scope.HDWallet.dPath = $scope.HDWallet.hwSocialPath;
break;
case nodes.nodeTypes.MUSIC:
$scope.HDWallet.dPath = $scope.HDWallet.hwMusicoinPath;
break;
default:
$scope.HDWallet.dPath = $scope.HDWallet.defaultDPath;
}
Expand Down
18 changes: 16 additions & 2 deletions app/scripts/directives/walletDecryptDrtv.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h4 translate="decrypt_Access">
<!-- TREZOR -->
<label class="radio"
aria-flowto="aria4"
ng-show="ajaxReq.type=='ETH'||ajaxReq.type=='ETC'||ajaxReq.type=='ROPSTEN ETH'||ajaxReq.type=='RINKEBY ETH'||ajaxReq.type=='KOVAN ETH'||ajaxReq.type=='EXP'||ajaxReq.type=='UBQ'||ajaxReq.type=='RSK'||ajaxReq.type=='POA'||ajaxReq.type=='TOMO'||ajaxReq.type=='ELLA'||ajaxReq.type=='EGEM'||ajaxReq.type=='CLO'||ajaxReq.type=='ETSC'">
ng-show="ajaxReq.type=='ETH'||ajaxReq.type=='ETC'||ajaxReq.type=='ROPSTEN ETH'||ajaxReq.type=='RINKEBY ETH'||ajaxReq.type=='KOVAN ETH'||ajaxReq.type=='EXP'||ajaxReq.type=='UBQ'||ajaxReq.type=='RSK'||ajaxReq.type=='POA'||ajaxReq.type=='TOMO'||ajaxReq.type=='ELLA'||ajaxReq.type=='EGEM'||ajaxReq.type=='CLO'||ajaxReq.type=='ETSC'||ajaxReq.type=='MUSIC'">
<input aria-flowto="aria4"
type="radio"
aria-label="Trezor Hardware Wallet"
Expand Down Expand Up @@ -769,7 +769,7 @@ <h4 id="modalTitle" class="modal-title" translate="ADD_Radio_5_Path" style="marg
</h4>

<p class="alert alert-danger"
ng-hide="ajaxReq.type=='ETH'||ajaxReq.type=='ETC'||ajaxReq.type=='ROPSTEN ETH'||ajaxReq.type=='RINKEBY ETH'||ajaxReq.type=='KOVAN ETH'||ajaxReq.type=='EXP'||ajaxReq.type=='UBQ'||ajaxReq.type=='ELLA'||ajaxReq.type=='EGEM'||ajaxReq.type=='CLO'||ajaxReq.type=='ETSC'">
ng-hide="ajaxReq.type=='ETH'||ajaxReq.type=='ETC'||ajaxReq.type=='ROPSTEN ETH'||ajaxReq.type=='RINKEBY ETH'||ajaxReq.type=='KOVAN ETH'||ajaxReq.type=='EXP'||ajaxReq.type=='UBQ'||ajaxReq.type=='ELLA'||ajaxReq.type=='EGEM'||ajaxReq.type=='CLO'||ajaxReq.type=='ETSC'||ajaxReq.type=='MUSIC'">
We do not know the correct path for this network.
<a href="https://github.com/kvhnuke/etherwallet/issues"
target="_blank"
Expand Down Expand Up @@ -951,6 +951,20 @@ <h4 id="modalTitle" class="modal-title" translate="ADD_Radio_5_Path" style="marg
</label>
</div>

<div class="col-sm-4">
<label class="radio small">
<input aria-describedby="Path: TREZOR (MUSIC) {{HDWallet.hwMusicoinPath}}"
ng-change="onHDDPathChange()"
ng-model="HDWallet.dPath"
type="radio"
value="{{HDWallet.hwMusicoinPath}}"/>
<span ng-bind="HDWallet.hwMusicoinPath"></span>
<p class="small">
Network: Musicoin
</p>
</label>
</div>

<section class="row">
<div class="col-sm-4">
<label class="radio small">
Expand Down
18 changes: 16 additions & 2 deletions app/scripts/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ nodes.nodeTypes = {
CLO: "CLO",
EAST: "EAST",
X888: "X88",
MUSIC: "MUSIC",
Custom: "CUSTOM ETH"
};
nodes.ensNodeTypes = [nodes.nodeTypes.ETH, nodes.nodeTypes.Ropsten];
Expand Down Expand Up @@ -310,8 +311,8 @@ nodes.nodeList = {
'estimateGas': true,
'service': 'easthub.io',
'lib': new nodes.customNode('https://node.easthub.io', '')
},
'x888': {
},
'x888': {
'name': 'X888',
'blockExplorerTX': 'https://myetherwallet.com/?[[txHash]]#check-tx-status',
'blockExplorerAddr': 'https://myetherwallet.com/?[[address]]#view-wallet-info',
Expand All @@ -323,6 +324,19 @@ nodes.nodeList = {
'estimateGas': true,
'service': 'eightereum',
'lib': new nodes.customNode('https://eightereum.x888.io', '')
},
'music': {
'name': 'MUSIC',
'blockExplorerTX': 'https://explorer.musicoin.org/tx/[[txHash]]',
'blockExplorerAddr': 'https://explorer.musicoin.org/account/[[address]]',
'type': nodes.nodeTypes.MUSIC,
'eip155': true,
'chainId': 7762959,
'tokenList': require('./tokens/musicTokens.json'),
'abiList': require('./abiDefinitions/musicAbi.json'),
'estimateGas': true,
'service': 'musicoin.org',
'lib': new nodes.customNode('https://mcdnode.trustfarm.io/api', '')
}
};

Expand Down
27 changes: 25 additions & 2 deletions app/styles/etherwallet-custom.less
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ label small {
@brand-test: #adc101;
@brand-rsk: #ff794f;
@brand-exp: #673ab7;
@brand-music: #b37aff;
@brand-ubq: #00ad85;
@brand-poa: #4568bb;
@brand-tomo: #6a488d;
Expand All @@ -594,6 +593,8 @@ label small {
@brand-egem: #0e97c0;
@brand-clo: #009241;
@brand-east: #0e97c0;
@brand-x888: #ff9;
@brand-music: #fece00;
@brand-cust: #b50085;

.dropdown-node .dropdown-menu {
Expand Down Expand Up @@ -651,6 +652,12 @@ label small {
li:nth-child(21) {
border-left: 2px solid @brand-east;
}
li:nth-child(22) {
border-left: 2px solid @brand-x888;
}
li:nth-child(23) {
border-left: 2px solid @brand-music;
}
li:last-child {
border-left: 2px solid @gray-light;
}
Expand All @@ -664,7 +671,9 @@ label small {
li:nth-child(18),
li:nth-child(19),
li:nth-child(20),
li:nth-child(21) {
li:nth-child(21),
li:nth-child(22),
li:nth-child(23) {
border-bottom: 1px solid @gray-lighter;
}
}
Expand Down Expand Up @@ -784,6 +793,20 @@ header.EAST {
& + .container .alert-info { background-color:@brand-east; }
}

header.X888 {
.nav-container { border-top: 0.25rem solid @brand-x888; }
& + .container + .pre-footer + .footer { border-top: 0.25rem solid @brand-x888; }
& + .container .modal-content { border: 0.25rem solid @brand-x888; }
& + .container .alert-info { background-color:@brand-x888; }
}

header.MUSIC {
.nav-container { border-top: 0.25rem solid @brand-music; }
& + .container + .pre-footer + .footer { border-top: 0.25rem solid @brand-music; }
& + .container .modal-content { border: 0.25rem solid @brand-music; }
& + .container .alert-info { background-color:@brand-music; }
}

.contest-container {
align-content: center;
display: flex;
Expand Down

0 comments on commit 813aed7

Please sign in to comment.