Skip to content

Commit e0e7763

Browse files
committed
Merge branch 'main' of github.com:AmbireTech/ambire-common into v2
2 parents 35c2751 + f37ede6 commit e0e7763

5 files changed

Lines changed: 13 additions & 24 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.93.1",
2+
"version": "2.93.2",
33
"name": "ambire-common",
44
"description": "Common ground for the Ambire apps",
55
"scripts": {

src/controllers/accountPicker/accountPicker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,6 @@ export class AccountPickerController extends EventEmitter implements IAccountPic
882882
}
883883

884884
const masterFingerprint = this.#externalSignerControllers.qr?.masterFingerprint || ''
885-
const qrWalletConfig = keyType === 'qr' ? this.keyIterator.walletConfig : undefined
886885

887886
const hdPathTemplate = this.hdPathTemplate as HD_PATH_TEMPLATE_TYPE
888887

src/controllers/main/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,11 +1157,11 @@ export class MainController extends EventEmitter implements IMainController {
11571157

11581158
const keyIterator = new QrKeyIterator({ controller: qrCtrl })
11591159
// Initialize the QR iterator from payload before AccountPicker init.
1160-
// This populates QR-specific iterator state (walletConfig, xpub, parsedAccount)
1160+
// This populates QR-specific iterator state (xpub, parsedAccount, hdPathTemplate)
11611161
// that AccountPicker needs to configure derivation and retrieval.
11621162
await keyIterator.initFromQrPayload(payload)
11631163

1164-
const hdPathTemplate = keyIterator.walletConfig?.hdPathTemplate
1164+
const hdPathTemplate = keyIterator.hdPathTemplate
11651165
if (!hdPathTemplate) {
11661166
const message = 'Invalid QR hardware wallet payload. Please try again.'
11671167
throw new EmittableError({

src/controllers/portfolio/portfolio.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,13 +941,20 @@ export class PortfolioController extends EventEmitter implements IPortfolioContr
941941
if (res.data.banner) {
942942
const banner = res.data.banner
943943

944+
const endTimeNumber =
945+
typeof banner.endTime === 'number' ? banner.endTime : new Date(banner.endTime).getTime()
946+
const startTimeNumber =
947+
typeof banner.startTime === 'number'
948+
? banner.startTime
949+
: new Date(banner.startTime).getTime()
950+
944951
const formattedBanner: Banner = {
945952
// eslint-disable-next-line no-underscore-dangle
946953
id: banner.id || banner._id,
947954
type: banner.type || 'updates',
948955
meta: {
949-
startTime: banner.startTime,
950-
endTime: banner.endTime
956+
startTime: startTimeNumber,
957+
endTime: endTimeNumber
951958
},
952959
...(banner.text && { text: banner.text }),
953960
...(banner.title && { title: banner.title }),

src/interfaces/keyIterator.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
import { HD_PATH_TEMPLATE_TYPE } from '../consts/derivation'
22
import { SelectedAccountForImport } from './account'
3-
import {
4-
ExternalSignerController,
5-
Key,
6-
ParsedQrAccount,
7-
QrProtocolType,
8-
QrWalletType
9-
} from './keystore'
3+
import { ExternalSignerController, Key, ParsedQrAccount, QrProtocolType } from './keystore'
104

115
export type QrWalletConfig = {
12-
walletType: QrWalletType
136
protocol: QrProtocolType
147
label: string
15-
hdPathTemplate: string
16-
relativePathTemplate: string
178
tutorialUrl?: string
189
}
1910

20-
type QrParsedAccountMeta = {
21-
hdPath?: string
22-
accounts?: Array<{
23-
hdPath?: string
24-
}>
25-
}
26-
2711
export interface KeyIterator {
2812
type: Key['type']
2913
subType: 'seed' | 'private-key' | 'hw'
@@ -58,6 +42,5 @@ export interface KeyIterator {
5842
/** Checks if the seed matches the key iterator's seed (optional, for hot wallets) */
5943
isSeedMatching?: (seedToCompareWith: string) => boolean
6044
// QR-specific optional fields
61-
walletConfig?: QrWalletConfig
6245
parsedAccount?: ParsedQrAccount
6346
}

0 commit comments

Comments
 (0)