Skip to content

Commit d979019

Browse files
committed
🚨 (aleo-signer): Fix linter issues
1 parent a254995 commit d979019

24 files changed

Lines changed: 99 additions & 108 deletions

‎apps/docs/pages/docs/references/signers/aleo.mdx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ type Signature = {
179179
This method allows users to sign a text string that is displayed on Ledger devices.
180180

181181
```typescript
182-
const { observable, cancel } = signerAleo.signMessage(
183-
derivationPath,
184-
message,
185-
);
182+
const { observable, cancel } = signerAleo.signMessage(derivationPath, message);
186183
```
187184

188185
#### **Parameters**

‎apps/sample/src/app/client-layout.tsx‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import { CalInterceptorProvider } from "@/providers/CalInterceptorProvider";
2323
import { DmkProvider } from "@/providers/DeviceManagementKitProvider";
2424
import { LedgerKeyringProtocolProvider } from "@/providers/LedgerKeyringProvider";
2525
import { SettingsGate } from "@/providers/SettingsGate";
26-
import { SignerEthProvider } from "@/providers/SignerEthProvider";
2726
import { SignerAleoProvider } from "@/providers/SignerAleoProvider";
27+
import { SignerEthProvider } from "@/providers/SignerEthProvider";
2828
import { store } from "@/state/store";
2929
import { GlobalStyle } from "@/styles/globalstyles";
3030

@@ -75,16 +75,16 @@ const ClientRootLayout: React.FC<PropsWithChildren> = ({ children }) => {
7575
<LedgerKeyringProtocolProvider>
7676
<SignerEthProvider>
7777
<SignerAleoProvider>
78-
<CalInterceptorProvider>
79-
<GlobalStyle />
80-
<head>
81-
<link rel="shortcut icon" href="../favicon.png" />
82-
</head>
83-
<body>
84-
<RootApp>{children}</RootApp>
85-
</body>
86-
</CalInterceptorProvider>
87-
</SignerAleoProvider>
78+
<CalInterceptorProvider>
79+
<GlobalStyle />
80+
<head>
81+
<link rel="shortcut icon" href="../favicon.png" />
82+
</head>
83+
<body>
84+
<RootApp>{children}</RootApp>
85+
</body>
86+
</CalInterceptorProvider>
87+
</SignerAleoProvider>
8888
</SignerEthProvider>
8989
</LedgerKeyringProtocolProvider>
9090
</DmkProvider>

‎apps/sample/src/components/SignerAleoView/index.tsx‎

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import {
66
type GetAppConfigDAError,
77
type GetAppConfigDAIntermediateValue,
88
type GetAppConfigDAOutput,
9-
type SignMessageDAError,
10-
type SignMessageDAIntermediateValue,
11-
type SignMessageDAOutput,
129
type SignTransactionDAError,
1310
type SignTransactionDAIntermediateValue,
1411
type SignTransactionDAOutput,
@@ -52,7 +49,11 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
5249
{
5350
title: "Get Address",
5451
description: "Get an address from the device",
55-
executeDeviceAction: ({ derivationPath, checkOnDevice, skipOpenApp }) => {
52+
executeDeviceAction: ({
53+
derivationPath,
54+
checkOnDevice,
55+
skipOpenApp,
56+
}) => {
5657
if (!signer) {
5758
throw new Error("Signer not initialized");
5859
}
@@ -90,12 +91,12 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
9091
transaction
9192
.slice(2)
9293
.match(/.{1,2}/g)
93-
?.map((byte) => parseInt(byte, 16)) ?? []
94+
?.map((byte) => parseInt(byte, 16)) ?? [],
9495
)
9596
: new Uint8Array(
9697
transaction
9798
.match(/.{1,2}/g)
98-
?.map((byte) => parseInt(byte, 16)) ?? []
99+
?.map((byte) => parseInt(byte, 16)) ?? [],
99100
);
100101
return signer.signTransaction(derivationPath, txBytes, {
101102
skipOpenApp,
@@ -117,29 +118,6 @@ export const SignerAleoView: React.FC<{ sessionId: string }> = ({
117118
SignTransactionDAError,
118119
SignTransactionDAIntermediateValue
119120
>,
120-
{
121-
title: "Sign Message",
122-
description: "Sign a message with the device",
123-
executeDeviceAction: ({ derivationPath, message }) => {
124-
if (!signer) {
125-
throw new Error("Signer not initialized");
126-
}
127-
return signer.signMessage(derivationPath, message);
128-
},
129-
initialValues: {
130-
derivationPath: "44'/0'/0'/0/0",
131-
message: "Hello World",
132-
},
133-
deviceModelId,
134-
} satisfies DeviceActionProps<
135-
SignMessageDAOutput,
136-
{
137-
derivationPath: string;
138-
message: string;
139-
},
140-
SignMessageDAError,
141-
SignMessageDAIntermediateValue
142-
>,
143121
],
144122
[deviceModelId, signer],
145123
);

‎packages/signer/signer-aleo/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ All notable changes to this project will be documented in this file.
55
## [0.1.0] - 2026-02-05
66

77
### Added
8+
89
- Initial signer implementation for aleo

‎packages/signer/signer-aleo/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const address = await signer.getAddress("m/44'/0'/0'/0/0");
2121
// Sign transaction
2222
const signature = await signer.signTransaction(
2323
"m/44'/0'/0'/0/0",
24-
transactionBytes
24+
transactionBytes,
2525
);
2626
```
2727

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
import { eslintConfigDmk } from "@ledgerhq/eslint-config-dsdk";
1+
import config from "@ledgerhq/eslint-config-dsdk";
22

3-
export default eslintConfigDmk;
3+
export default [
4+
...config,
5+
{
6+
ignores: ["eslint.config.mjs", "lib", "vitest.*.mjs"],
7+
languageOptions: {
8+
parserOptions: {
9+
project: "./tsconfig.json",
10+
},
11+
},
12+
},
13+
];

‎packages/signer/signer-aleo/src/api/SignerAleo.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { type GetAppConfigDAReturnType } from "@api/app-binder/GetAppConfigDeviceActionTypes";
21
import { type GetAddressDAReturnType } from "@api/app-binder/GetAddressDeviceActionTypes";
3-
import { type AddressOptions } from "@api/model/AddressOptions";
2+
import { type GetAppConfigDAReturnType } from "@api/app-binder/GetAppConfigDeviceActionTypes";
3+
import { type SignMessageDAReturnType } from "@api/app-binder/SignMessageDeviceActionTypes";
44
import { type SignTransactionDAReturnType } from "@api/app-binder/SignTransactionDeviceActionTypes";
5+
import { type AddressOptions } from "@api/model/AddressOptions";
56
import { type TransactionOptions } from "@api/model/TransactionOptions";
6-
import { type SignMessageDAReturnType } from "@api/app-binder/SignMessageDeviceActionTypes";
77

88
export interface SignerAleo {
99
getAppConfig: () => GetAppConfigDAReturnType;

‎packages/signer/signer-aleo/src/api/app-binder/GetAddressDeviceActionTypes.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import { type GetAddressCommandResponse } from "@internal/app-binder/command/Get
1111
import { type AleoErrorCodes } from "@internal/app-binder/command/utils/aleoApplicationErrors";
1212

1313
type GetAddressDAUserInteractionRequired =
14-
| UserInteractionRequired.None | UserInteractionRequired.VerifyAddress;
14+
| UserInteractionRequired.None
15+
| UserInteractionRequired.VerifyAddress;
1516

1617
export type GetAddressDAOutput =
1718
SendCommandInAppDAOutput<GetAddressCommandResponse>;

‎packages/signer/signer-aleo/src/api/app-binder/GetAppConfigDeviceActionTypes.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import {
77
type UserInteractionRequired,
88
} from "@ledgerhq/device-management-kit";
99

10-
import { type GetAppConfigCommandResponse } from "@internal/app-binder/command/GetAppConfigCommand";
10+
import type { AppConfig } from "@api/model/AppConfig";
1111
import { type AleoErrorCodes } from "@internal/app-binder/command/utils/aleoApplicationErrors";
1212

13-
type GetAppConfigDAUserInteractionRequired =
14-
| UserInteractionRequired.None;
13+
type GetAppConfigDAUserInteractionRequired = UserInteractionRequired.None;
1514

16-
export type GetAppConfigDAOutput =
17-
SendCommandInAppDAOutput<GetAppConfigCommandResponse>;
15+
export type GetAppConfigDAOutput = SendCommandInAppDAOutput<AppConfig>;
1816

1917
export type GetAppConfigDAError =
2018
| OpenAppDAError

‎packages/signer/signer-aleo/src/api/app-binder/SignMessageDeviceActionTypes.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import { type SignMessageCommandResponse } from "@internal/app-binder/command/Si
1111
import { type AleoErrorCodes } from "@internal/app-binder/command/utils/aleoApplicationErrors";
1212

1313
type SignMessageDAUserInteractionRequired =
14-
| UserInteractionRequired.None | UserInteractionRequired.SignPersonalMessage;
14+
| UserInteractionRequired.None
15+
| UserInteractionRequired.SignPersonalMessage;
1516

1617
export type SignMessageDAOutput =
1718
SendCommandInAppDAOutput<SignMessageCommandResponse>;

0 commit comments

Comments
 (0)