Skip to content

Commit

Permalink
simplify type for getResponseWithContent
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeRx committed Jan 11, 2024
1 parent 339002c commit 3405a35
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 5 additions & 2 deletions packages/snaps-controllers/src/snaps/SnapController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import type {
RequestSnapsParams,
RequestSnapsResult,
SnapId,
HandlerResponsesWithUI,
Component,
} from '@metamask/snaps-sdk';
import { AuxiliaryFileEncoding, getErrorMessage } from '@metamask/snaps-sdk';
import type {
Expand Down Expand Up @@ -2921,7 +2921,10 @@ export class SnapController extends BaseController<
* @param result - The result of the RPC request.
* @returns The UI components.
*/
#getResponseWithContent(snapId: SnapId, result: HandlerResponsesWithUI) {
#getResponseWithContent(
snapId: SnapId,
result: { content: Component } | { id: string },
) {
if (hasProperty(result, 'id')) {
const { content } = this.#getInterface(snapId, result.id as string);
return content;
Expand Down
3 changes: 0 additions & 3 deletions packages/snaps-sdk/src/types/handlers/handlers.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/snaps-sdk/src/types/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export * from './rpc-request';
export * from './transaction';
export * from './signature';
export * from './user-input';
export * from './handlers';

0 comments on commit 3405a35

Please sign in to comment.