Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ledger): log transaction payload prior to sending to ledger #5885

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 9 additions & 2 deletions src/app/features/ledger/utils/stacks-ledger-utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import Transport from '@ledgerhq/hw-transport-webusb';
import {
AddressVersion,
Expand Down Expand Up @@ -60,8 +61,14 @@ export const prepareLedgerDeviceStacksAppConnection = prepareLedgerDeviceForAppF
) as (args: PrepareLedgerDeviceConnectionArgs) => Promise<StacksApp>;

export function signLedgerStacksTransaction(app: StacksApp) {
return async (payload: Buffer, accountIndex: number) =>
app.sign(stxDerivationWithAccount.replace('{account}', accountIndex.toString()), payload);
return async (payload: Buffer, accountIndex: number) => {
console.log('Logging serialised stacks transaction');
console.log(payload.toString('hex'));
return app.sign(
stxDerivationWithAccount.replace('{account}', accountIndex.toString()),
payload
);
};
}

export function signLedgerStacksUtf8Message(app: StacksApp) {
Expand Down
Loading