Skip to content

Commit

Permalink
updating the types file
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy committed Sep 24, 2024
1 parent 7b9db26 commit b299b24
Showing 1 changed file with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
import type {
JsonRpcEngineNextCallback,
JsonRpcEngineEndCallback,
} from '@metamask/json-rpc-engine';
} from 'json-rpc-engine';
import type {
JsonRpcRequest,
PendingJsonRpcResponse,
JsonRpcParams,
} from '@metamask/utils';
import { OriginString } from '@metamask/permission-controller';
import { MESSAGE_TYPE } from '../../../../../shared/constants/app';
import {
HandlerWrapper,
GetProviderState,
ProviderStateHandlerResult,
} from './handlers-helper';
import { HandlerWrapper } from './types';

/**
* @property chainId - The current chain ID.
* @property isUnlocked - Whether the extension is unlocked or not.
* @property networkVersion - The current network ID.
* @property accounts - List of permitted accounts for the specified origin.
*/
type ProviderStateHandlerResult = {
chainId: string;
isUnlocked: boolean;
networkVersion: string;
accounts: string[];
};

type GetProviderState = (
origin: OriginString,
) => Promise<ProviderStateHandlerResult>;

type GetProviderStateConstraint<Params extends JsonRpcParams = JsonRpcParams> =
{
Expand Down

0 comments on commit b299b24

Please sign in to comment.