Skip to content

Commit 02f1462

Browse files
committed
Fina Portal HWW
1 parent a3de24a commit 02f1462

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

src/app/hardware/portal/hww.ts

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,41 @@
11
import { multiply, NFC, Poll, Network, Bitcoin as BitcoinType, Signet as SignetType } from 'libportal-react-native';
2-
import { GetStatus } from './types'; // Assuming GetStatus is defined in a separate 'types' file
2+
import { GetStatus as GetStatusType } from './types'; // Assuming GetStatus is a type or object from the 'types' module
33

44
export class Hww {
55
static multiply(a: number, b: number): Promise<number> {
66
return multiply(a, b);
77
}
88
}
99

10-
export const poll = {
10+
// Shared structure for consistency
11+
const sharedStructure = {
1112
poll: Poll,
1213
nfc: NFC,
1314
};
1415

15-
export const newTag = {
16-
poll: Poll,
17-
nfc: NFC,
18-
};
16+
export const poll = { ...sharedStructure };
1917

20-
export const IncomingData = {
21-
poll: Poll,
22-
nfc: NFC,
23-
};
18+
export const newTag = { ...sharedStructure };
19+
20+
export const IncomingData = { ...sharedStructure };
2421

2522
export const GetStatus = {
26-
getStatus: GetStatus, // Changed to avoid confusion
23+
getStatus: GetStatusType, // Using a type-safe alias
2724
nfc: NFC,
2825
};
2926

3027
export const NetworkConfig = {
31-
Bitcoin: BitcoinType, // Renamed to avoid conflict with imported Bitcoin
32-
Signet: SignetType, // Renamed to avoid conflict with imported Signet
28+
Bitcoin: BitcoinType, // Explicitly distinguish imported Bitcoin
29+
Signet: SignetType, // Explicitly distinguish imported Signet
3330
};
3431

35-
export const GenerateMnemonic = {
36-
poll: Poll,
37-
nfc: NFC,
38-
};
32+
export const GenerateMnemonic = { ...sharedStructure };
3933

40-
export const Unlock = {
41-
poll: Poll,
42-
nfc: NFC,
43-
};
34+
export const Unlock = { ...sharedStructure };
4435

45-
export const DisplayAddress = {
46-
poll: Poll,
47-
nfc: NFC,
48-
};
36+
export const DisplayAddress = { ...sharedStructure };
4937

50-
export const signPSBT = {
51-
poll: Poll,
52-
nfc: NFC,
53-
};
38+
export const signPSBT = { ...sharedStructure };
39+
40+
export const PublicDescriptor = { ...sharedStructure };
5441

55-
export const PublicDescriptor = {
56-
poll: Poll,
57-
nfc: NFC,
58-
};

0 commit comments

Comments
 (0)