diff --git a/src/background/controller/wallet.ts b/src/background/controller/wallet.ts index 400c536b..3a3ec735 100644 --- a/src/background/controller/wallet.ts +++ b/src/background/controller/wallet.ts @@ -26,7 +26,11 @@ import { import eventBus from '@/eventBus'; import { type FeatureFlagKey, type FeatureFlags } from '@/shared/types/feature-types'; import { type TrackingEvents } from '@/shared/types/tracking-types'; -import { type ActiveChildType, type LoggedInAccount } from '@/shared/types/wallet-types'; +import { + type ActiveChildType, + type LoggedInAccount, + type PublicKeyTuple, +} from '@/shared/types/wallet-types'; import { ensureEvmAddressPrefix, isValidEthereumAddress, withPrefix } from '@/shared/utils/address'; import { getHashAlgo, getSignAlgo } from '@/shared/utils/algo'; import { retryOperation } from '@/shared/utils/retryOperation'; @@ -531,7 +535,7 @@ export class WalletController extends BaseController { return privateKey; }; - getPubKey = async () => { + getPubKey = async (): Promise => { let privateKey; let pubKTuple; const keyrings = await keyringService.getKeyring(); @@ -565,7 +569,14 @@ export class WalletController extends BaseController { const error = new Error('No mnemonic or private key found in any of the keyrings.'); throw error; } - return pubKTuple; + return { + P256: { + pubK: pubKTuple.P256.pubK, + }, + SECP256K1: { + pubK: pubKTuple.SECP256K1.pubK, + }, + }; }; importPrivateKey = async (data) => { diff --git a/src/background/service/openapi.ts b/src/background/service/openapi.ts index 65a72da0..5e1c2907 100644 --- a/src/background/service/openapi.ts +++ b/src/background/service/openapi.ts @@ -24,6 +24,7 @@ import { type LoggedInAccount, type FlowAddress, type ActiveChildType, + type PublicKeyTuple, } from '@/shared/types/wallet-types'; import { isValidFlowAddress, isValidEthereumAddress } from '@/shared/utils/address'; import { getStringFromHashAlgo, getStringFromSignAlgo } from '@/shared/utils/algo'; @@ -2349,7 +2350,7 @@ class OpenApiService { freshUserInfo = async ( currentWallet: BlockchainResponse, keys: FclAccount, - pubKTuple, + pubKTuple: PublicKeyTuple, wallet, isChild: ActiveChildType ) => { diff --git a/src/shared/types/wallet-types.ts b/src/shared/types/wallet-types.ts index ba9ddb07..a4bb37cc 100644 --- a/src/shared/types/wallet-types.ts +++ b/src/shared/types/wallet-types.ts @@ -52,3 +52,12 @@ export type LoggedInAccount = { export type LoggedInAccountWithIndex = LoggedInAccount & { indexInLoggedInAccounts: number; }; + +export type PublicKeyTuple = { + P256: { + pubK: string; + }; + SECP256K1: { + pubK: string; + }; +};