diff --git a/packages/launchpad-ledger/src/demo/node.ts b/packages/launchpad-ledger/src/demo/node.ts index 86483529..f0299bd8 100644 --- a/packages/launchpad-ledger/src/demo/node.ts +++ b/packages/launchpad-ledger/src/demo/node.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { toBase64 } from "@cosmjs/encoding"; -import { makeCosmoshubPath, makeSignBytes, StdFee, StdSignature } from "@cosmjs/launchpad"; +import { makeSignBytes, StdFee, StdSignature } from "@cosmjs/launchpad"; import { LedgerSigner } from "../ledgersigner"; @@ -11,11 +11,10 @@ const defaultFee: StdFee = { }; const defaultMemo = "Some memo"; const defaultSequence = "0"; -const defaultPrehashType = undefined; const signer = new LedgerSigner({ testModeAllowed: true, - hdPaths: [makeCosmoshubPath(0), makeCosmoshubPath(1), makeCosmoshubPath(2)], + accountNumbers: [0, 1, 2], }); export async function getAccounts(): Promise< @@ -57,5 +56,5 @@ export async function sign( accountNumber, defaultSequence, ); - return signer.sign(fromAddress, signBytes, defaultPrehashType, accountNumber); + return signer.sign(fromAddress, signBytes); } diff --git a/packages/launchpad-ledger/src/demo/web.ts b/packages/launchpad-ledger/src/demo/web.ts index b5790a08..51ee535b 100644 --- a/packages/launchpad-ledger/src/demo/web.ts +++ b/packages/launchpad-ledger/src/demo/web.ts @@ -1,5 +1,5 @@ import { toBase64, toUtf8 } from "@cosmjs/encoding"; -import { AccountData, makeCosmoshubPath } from "@cosmjs/launchpad"; +import { AccountData } from "@cosmjs/launchpad"; import { LedgerSigner } from "../ledgersigner"; @@ -34,7 +34,7 @@ function createMessage(accountNumber: number, address: string): string { const signer = new LedgerSigner({ testModeAllowed: true, - hdPaths: [makeCosmoshubPath(0), makeCosmoshubPath(1), makeCosmoshubPath(2)], + accountNumbers: [0, 1, 2], }); window.updateMessage = (accountNumber: number) => { @@ -80,11 +80,10 @@ window.sign = async function sign(): Promise { signatureDiv.textContent = "Loading..."; try { - const accountNumber = document.getElementById("account-number").value; const address = document.getElementById("address").value; const rawMessage = document.getElementById("message").textContent; const message = JSON.stringify(JSON.parse(rawMessage)); - const signature = await signer.sign(address, toUtf8(message), undefined, parseInt(accountNumber, 10)); + const signature = await signer.sign(address, toUtf8(message)); signatureDiv.textContent = JSON.stringify(signature, null, "\t"); } catch (error) { signatureDiv.textContent = error;