Skip to content

Commit

Permalink
rebasing and updating the branch
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy committed Jul 19, 2024
1 parent c938440 commit 88e900b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 154 deletions.
149 changes: 0 additions & 149 deletions app/scripts/lib/rpc-method-middleware/handlers/handlers-helper.ts

This file was deleted.

24 changes: 19 additions & 5 deletions app/scripts/lib/rpc-method-middleware/handlers/send-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
import { ethErrors } from 'eth-rpc-errors';
import {
JsonRpcEngineEndCallback,
JsonRpcEngineNextCallback,
} from 'json-rpc-engine';
import {
Json,
JsonRpcParams,
JsonRpcRequest,
PendingJsonRpcResponse,
} from '@metamask/utils';
import {
JsonRpcEngineEndCallback,
JsonRpcEngineNextCallback,
} from '@metamask/json-rpc-engine';
import { SubjectType } from '@metamask/permission-controller';
PermissionSubjectMetadata,
SubjectType,
} from '@metamask/permission-controller';
import { MESSAGE_TYPE } from '../../../../../shared/constants/app';
import { AddSubjectMetadata, HandlerWrapper } from './handlers-helper';
import { HandlerWrapper } from './types';

type SubjectMetadataToAdd = PermissionSubjectMetadata & {
name?: string | null;
subjectType?: SubjectType | null;
extensionId?: string | null;
iconUrl?: string | null;
} & Record<string, Json>;

type AddSubjectMetadata = (metadata: SubjectMetadataToAdd) => void;

type SendMetadataOptions = {
addSubjectMetadata: AddSubjectMetadata;
subjectType: SubjectType;
};

type SendMetadataConstraint<Params extends JsonRpcParams = JsonRpcParams> = {
implementation: (
req: JsonRpcRequest<Params>,
Expand Down

0 comments on commit 88e900b

Please sign in to comment.