Skip to content

Commit

Permalink
getLedger function
Browse files Browse the repository at this point in the history
  • Loading branch information
romefeller committed Dec 28, 2021
1 parent 5f43b3b commit b84e255
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ ENV GIT_URL https://github.com/obsidiansystems/kadena-transfer-js.git

RUN apt-get -y update \
&& apt-get -y install git \
&& git clone -b hw-ledger-signing ${GIT_URL} \
&& git clone -b jg-fix-ledger-transfer ${GIT_URL} \
&& cp -r /kadena-transfer-js/* /usr/share/nginx/html
14 changes: 8 additions & 6 deletions docs/transfer-ledger-create.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,17 @@
function formIsValid(){
return $('.form').form('is valid');
}

async function signWithLedger(){
async function getLedger(){
if (!window.ledger) {
var transp = await window.TranspWeb.create();
window.ledger = new window.Kadena(transp);
}
}

async function signWithLedger(){
getLedger();

if (document.getElementById("getPubkey-content").innerText == "") {
document.getElementById("publicKey").value = [ (await window.ledger.getPublicKey("44'/626'/0'")).publicKey ];
} else {
Expand All @@ -312,10 +317,7 @@
}

async function getPublicKeyFromLedger(){
if (!window.ledger) {
var transp = await window.TranspWeb.create();
window.ledger = new window.Kadena(transp);
}
getLedger();

var publicKey = (await window.ledger.getPublicKey("44'/626'/0'")).publicKey;
document.getElementById("publicKey").value = [ publicKey ];
Expand Down

0 comments on commit b84e255

Please sign in to comment.