UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

1 lines 1.31 kB
{"version":3,"file":"create-session.mjs","sourceRoot":"","sources":["../../../../src/types/methods/multichain/create-session.ts"],"names":[],"mappings":"","sourcesContent":["import type { CaipAccountId, CaipChainId, Json } from '@metamask/utils';\n\n/**\n * The scopes object for a given session.\n *\n * Each key contains the methods, notifications and accounts made available for a given scope.\n */\nexport type SessionScopes = Record<\n CaipChainId,\n {\n methods: string[];\n notifications: string[];\n accounts: CaipAccountId[];\n }\n>;\n\n/**\n * The request parameters for the `wallet_createSession` method.\n *\n * @property requiredScopes - The required scopes of the session.\n * @property optionalScopes - The optional scopes of the session.\n * @property sessionProperties - The additional properties of the session.\n */\nexport type CreateSessionParams = {\n requiredScopes?: SessionScopes;\n optionalScopes?: SessionScopes;\n sessionProperties?: Json;\n};\n\n/**\n * The result returned for the `wallet_createSession` method.\n *\n * @property sessionScopes - The scopes granted for the session.\n * @property sessionProperties - The additional properties of the session.\n */\nexport type CreateSessionResult = {\n sessionScopes: SessionScopes;\n sessionProperties: Json;\n};\n"]}