Skip to content

Commit

Permalink
✨ (signer-btc): Add builder
Browse files Browse the repository at this point in the history
  • Loading branch information
jdabbech-ledger committed Dec 17, 2024
1 parent 10f8353 commit 3044b2a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions packages/signer/signer-btc/src/api/SignerBtcBuiilder.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { type DeviceManagementKit } from "@ledgerhq/device-management-kit";

import { SignerBtcBuilder } from "@api/SignerBtcBuilder";

describe("SignerBtcBuilder", () => {
const dmk: DeviceManagementKit = {} as DeviceManagementKit;

test("should be an instance of SignerBtc", () => {
// GIVEN
const builder = new SignerBtcBuilder({ dmk, sessionId: "" });

// WHEN
builder.build();

// THEN
expect(builder).toBeInstanceOf(SignerBtcBuilder);
});
});
4 changes: 2 additions & 2 deletions packages/signer/signer-btc/src/api/SignerBtcBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type SignerBtcBuilderConstructorArgs = {
* ```
*/
export class SignerBtcBuilder {
private _dmk: DeviceManagementKit;
private _sessionId: DeviceSessionId;
private readonly _dmk: DeviceManagementKit;
private readonly _sessionId: DeviceSessionId;

constructor({ dmk, sessionId }: SignerBtcBuilderConstructorArgs) {
this._dmk = dmk;
Expand Down
1 change: 1 addition & 0 deletions packages/signer/signer-btc/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { type SignerBtc } from "./SignerBtc";
export { SignerBtcBuilder } from "./SignerBtcBuilder";
export * from "@api/app-binder/GetExtendedPublicKeyDeviceActionTypes";
export type {
SignMessageDAError,
Expand Down

0 comments on commit 3044b2a

Please sign in to comment.