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

Enable Ledger Hardware Wallet support for Atheios (ATH) #2030

Merged
merged 4 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions app/images/coins/atheios.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/scripts/abiDefinitions/athAbi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
9 changes: 9 additions & 0 deletions app/scripts/controllers/decryptWalletCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
hwAkromaPath: "m/44'/200625'/0'/0", // first address: m/44'/200625'/0'/0/0
hwESNetworkPath: "m/44'/31102'/0'/0", // first address: m/44'/31102'/0'/0/0
hwEther1Path: "m/44'/1313114'/0'/0", // first address: m/44'/1313114'/0'/0/0
hwAtheiosPath: "m/44'/1620'/0'/0", // first address: m/44'/1620'/0'/0/0
};
$scope.HDWallet.dPath = $scope.HDWallet.defaultDPath;
$scope.mnemonicModel = new Modal(document.getElementById('mnemonicModel'));
Expand Down Expand Up @@ -77,6 +78,8 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
case nodes.nodeTypes.ETHO:
$scope.HDWallet.dPath = $scope.HDWallet.hwEther1Path;
break;
case nodes.nodeTypes.ATH:
$scope.HDWallet.dPath = $scope.HDWallet.hwAtheiosPath;
case nodes.nodeTypes.EGEM:
$scope.HDWallet.dPath = $scope.HDWallet.hwEtherGemPath;
break;
Expand Down Expand Up @@ -133,6 +136,9 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
case nodes.nodeTypes.ESN:
$scope.HDWallet.dPath = $scope.HDWallet.hwESNetworkPath;
break;
case nodes.nodeTypes.ATH:
$scope.HDWallet.dPath = $scope.HDWallet.hwAtheiosPath;
break;
default:
$scope.HDWallet.dPath = $scope.HDWallet.trezorPath;
}
Expand Down Expand Up @@ -186,6 +192,9 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
case nodes.nodeTypes.ETHO:
$scope.HDWallet.dPath = $scope.HDWallet.hwEther1Path;
break;
case nodes.nodeTypes.ATH:
$scope.HDWallet.dPath = $scope.HDWallet.hwAtheiosPath;
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 @@ -35,7 +35,7 @@ <h4 translate="decrypt_Access">
<!-- Ledger -->
<label aria-flowto="aria3"
class="radio"
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=='POA'||ajaxReq.type=='TOMO'||ajaxReq.type=='ESN'||ajaxReq.type=='AKROMA'||ajaxReq.type=='PIRL'||ajaxReq.type=='ETHO'||ajaxReq.type=='EGEM'||ajaxReq.type=='CLO'">
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=='POA'||ajaxReq.type=='TOMO'||ajaxReq.type=='ESN'||ajaxReq.type=='AKROMA'||ajaxReq.type=='PIRL'||ajaxReq.type=='ETHO'||ajaxReq.type=='EGEM'||ajaxReq.type=='CLO'||ajaxReq.type=='ATH'">
<input aria-flowto="aria3"
type="radio"
aria-label="Ledger 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'||ajaxReq.type=='MUSIC'||ajaxReq.type=='GO'||ajaxReq.type=='EOSC'||ajaxReq.type=='POA'||ajaxReq.type=='AKROMA'||ajaxReq.type=='ESN'||ajaxReq.type=='PIRL'||ajaxReq.type=='ETHO'">
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'||ajaxReq.type=='GO'||ajaxReq.type=='EOSC'||ajaxReq.type=='POA'||ajaxReq.type=='AKROMA'||ajaxReq.type=='ESN'||ajaxReq.type=='PIRL'||ajaxReq.type=='ETHO'||ajaxReq.type=='ATH'">
We do not know the correct path for this network.
<a href="https://github.com/kvhnuke/etherwallet/issues"
target="_blank"
Expand Down Expand Up @@ -1044,6 +1044,20 @@ <h4 id="modalTitle" class="modal-title" translate="ADD_Radio_5_Path" style="marg
</p>
</label>
</div>

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


<div class="col-sm-4">
Expand Down
14 changes: 14 additions & 0 deletions app/scripts/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ nodes.nodeTypes = {
ESN: "ESN",
PIRL: "PIRL",
ETHO: "ETHO",
ATH: "ATH",
Custom: "CUSTOM ETH"
};
nodes.ensNodeTypes = [nodes.nodeTypes.ETH, nodes.nodeTypes.Ropsten];
Expand Down Expand Up @@ -391,6 +392,19 @@ nodes.nodeList = {
estimateGas: true,
service: "ether1.org",
lib: new nodes.customNode("https://rpc.ether1.org", "")
},
ath: {
name: "ATH",
blockExplorerTX: "https://scan.atheios.com/tx/[[txHash]]",
blockExplorerAddr: "https://scan.atheios.com/addr/[[address]]",
type: nodes.nodeTypes.ATH,
eip155: true,
chainId: 1620,
tokenList: require("./tokens/athTokens.json"),
abiList: require("./abiDefinitions/athAbi.json"),
estimateGas: true,
service: "wallet.atheios.com",
lib: new nodes.customNode("https://wallet.atheios.com", "8797")
}
};

Expand Down
1 change: 1 addition & 0 deletions app/scripts/tokens/athTokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
18 changes: 17 additions & 1 deletion app/styles/etherwallet-custom.less
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ label small {
@brand-esn: #a16bff;
@brand-pirl: #a2d729;
@brand-etho: #d63068;
@brand-ath: #0099ff;
@brand-cust: #b50085;

.dropdown-node .dropdown-menu {
Expand Down Expand Up @@ -683,6 +684,9 @@ label small {
li:nth-child(28) {
border-left: 2px solid @brand-etho;
}
li:nth-child(29) {
border-left: 2px solid @brand-ath;
}

li:last-child {
border-left: 2px solid @gray-light;
Expand All @@ -703,7 +707,8 @@ label small {
li:nth-child(24),
li:nth-child(25),
li:nth-child(26),
li:nth-child(27) {
li:nth-child(27),
li:nth-child(28) {
border-bottom: 1px solid @gray-lighter;
}
}
Expand Down Expand Up @@ -927,6 +932,17 @@ header.ETHO {
}
}

header.ATH {
.header-branding { border-bottom: 0.25rem solid @brand-ath; }
& + .container + .pre-footer + .footer { border-top: 0.25rem solid @brand-ath; }
& + .container .modal-content { border: 0.25rem solid @brand-ath; }
& + .container .alert-info { background-color:@brand-ath; }
.dropdown-gas:before {
width: 36px;
background-image: url("../images/coins/atheios.svg");
}
}

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