diff --git a/packages/js-sdk/src/keystore/SnapKeystore.ts b/packages/js-sdk/src/keystore/SnapKeystore.ts index b4aab996..33af6dba 100644 --- a/packages/js-sdk/src/keystore/SnapKeystore.ts +++ b/packages/js-sdk/src/keystore/SnapKeystore.ts @@ -28,7 +28,7 @@ export function SnapKeystore( return snapRPC(method, rpc, undefined, snapMeta, snapId) as any } // eslint-disable-next-line @typescript-eslint/no-explicit-any - return snapRPC(method, rpc, req, snapMeta, snapId) as any + return snapRPC(method, rpc, req as any, snapMeta, snapId) as any } } diff --git a/packages/js-sdk/src/keystore/rpcDefinitions.ts b/packages/js-sdk/src/keystore/rpcDefinitions.ts index 3a06963a..21d23005 100644 --- a/packages/js-sdk/src/keystore/rpcDefinitions.ts +++ b/packages/js-sdk/src/keystore/rpcDefinitions.ts @@ -40,6 +40,15 @@ type ApiInterface = { [key: string]: (...args: any[]) => any } +type PrivatePreferenceKeystoreMethods = { + createPrivatePreference: ( + action: privatePreferences.PrivatePreferencesAction + ) => Promise + getPrivatePreferences: () => privatePreferences.PrivatePreferencesAction[] + getPrivatePreferencesTopic: () => Promise + savePrivatePreferences: (data: ActionsMap) => Promise +} + type OtherKeyStoreMethods = { /** * Get the account address of the wallet used to create the Keystore @@ -54,7 +63,8 @@ type ExtractInterface = Flatten< ? () => Promise : (req: Req) => Promise : never - } & OtherKeyStoreMethods + } & OtherKeyStoreMethods & + PrivatePreferenceKeystoreMethods > type ExtractInterfaceRequestEncoders = { @@ -218,19 +228,9 @@ export const apiDefs = { }, } -export type PrivatePreferenceKeystoreInterface = { - createPrivatePreference: ( - action: privatePreferences.PrivatePreferencesAction - ) => Promise - getPrivatePreferences: () => privatePreferences.PrivatePreferencesAction[] - getPrivatePreferencesTopic: () => Promise - savePrivatePreferences: (data: ActionsMap) => Promise -} - export type KeystoreApiDefs = typeof apiDefs export type KeystoreApiMethods = keyof KeystoreApiDefs -export type KeystoreInterface = ExtractInterface & - PrivatePreferenceKeystoreInterface +export type KeystoreInterface = ExtractInterface export type KeystoreApiEntries = Entries export type KeystoreApiRequestEncoders = ExtractInterfaceRequestEncoders @@ -251,10 +251,9 @@ export const snapApiDefs = { }, } -export type SnapKeystoreApiDefs = typeof snapApiDefs +export type SnapKeystoreApiDefs = typeof snapApiDefs & KeystoreApiDefs export type SnapKeystoreApiMethods = keyof SnapKeystoreApiDefs -export type SnapKeystoreInterface = KeystoreInterface & - ExtractInterface +export type SnapKeystoreInterface = ExtractInterface export type SnapKeystoreApiEntries = Entries export type SnapKeystoreApiRequestEncoders = ExtractInterfaceRequestEncoders