@metamask/connect-evm 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,23 @@
1
+ export const IGNORED_METHODS = [
2
+ 'metamask_getProviderState',
3
+ 'metamask_sendDomainMetadata',
4
+ 'metamask_logWeb3ShimUsage',
5
+ 'wallet_registerOnboarding',
6
+ 'net_version',
7
+ 'wallet_getPermissions',
8
+ ];
9
+ export const CONNECT_METHODS = [
10
+ 'wallet_requestPermissions',
11
+ 'eth_requestAccounts',
12
+ ];
13
+ export const ACCOUNTS_METHODS = ['eth_accounts', 'eth_coinbase'];
14
+ export const INTERCEPTABLE_METHODS = [
15
+ ...ACCOUNTS_METHODS,
16
+ ...IGNORED_METHODS,
17
+ ...CONNECT_METHODS,
18
+ // These have bespoke handlers
19
+ 'wallet_revokePermissions',
20
+ 'wallet_switchEthereumChain',
21
+ 'wallet_addEthereumChain',
22
+ ];
23
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,2BAA2B;IAC3B,6BAA6B;IAC7B,2BAA2B;IAC3B,2BAA2B;IAC3B,aAAa;IACb,uBAAuB;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,2BAA2B;IAC3B,qBAAqB;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,gBAAgB;IACnB,GAAG,eAAe;IAClB,GAAG,eAAe;IAClB,8BAA8B;IAC9B,0BAA0B;IAC1B,4BAA4B;IAC5B,yBAAyB;CAC1B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { getInfuraRpcUrls } from '@metamask/connect-multichain';
2
+ export { createMetamaskConnectEVM, type MetamaskConnectEVM } from './connect';
3
+ export type { EIP1193Provider } from './provider';
4
+ export type * from './types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,mBAAmB,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { getInfuraRpcUrls } from '@metamask/connect-multichain';
2
+ export { createMetamaskConnectEVM } from './connect';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAA2B,MAAM,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const logger: import("debug").Debugger;
2
+ export declare const enableDebug: (debugEnabled?: boolean) => void;
3
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,0BAAgC,CAAC;AAEpD,eAAO,MAAM,WAAW,GAAI,eAAc,OAAe,KAAG,IAK3D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { createLogger, enableDebug as debug, } from '@metamask/connect-multichain';
2
+ const namespace = 'metamask-connect:evm';
3
+ // @ts-expect-error logger needs to be typed properly
4
+ export const logger = createLogger(namespace, '63');
5
+ export const enableDebug = (debugEnabled = false) => {
6
+ if (debugEnabled) {
7
+ // @ts-expect-error logger needs to be typed properly
8
+ debug(namespace);
9
+ }
10
+ };
11
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,IAAI,KAAK,GACrB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAEzC,qDAAqD;AACrD,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,eAAwB,KAAK,EAAQ,EAAE;IACjE,IAAI,YAAY,EAAE,CAAC;QACjB,qDAAqD;QACrD,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { MultichainCore } from '@metamask/connect-multichain';
2
+ import { EventEmitter } from '@metamask/connect-multichain';
3
+ import type { Address, EIP1193ProviderEvents, Hex, ProviderRequest, ProviderRequestInterceptor } from './types';
4
+ /**
5
+ * EIP-1193 Provider wrapper around the Multichain SDK.
6
+ */
7
+ export declare class EIP1193Provider extends EventEmitter<EIP1193ProviderEvents> {
8
+ #private;
9
+ constructor(core: MultichainCore, interceptor: ProviderRequestInterceptor);
10
+ /**
11
+ * Performs a EIP-1193 request.
12
+ *
13
+ * @param request - The request object containing the method and params
14
+ * @returns The result of the request
15
+ */
16
+ request(request: ProviderRequest): Promise<unknown>;
17
+ get selectedAccount(): Address | undefined;
18
+ set accounts(accounts: Address[]);
19
+ get accounts(): Address[];
20
+ get selectedChainId(): Hex | undefined;
21
+ set selectedChainId(chainId: Hex | number | undefined);
22
+ }
23
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAK5D,OAAO,KAAK,EACV,OAAO,EACP,qBAAqB,EACrB,GAAG,EACH,eAAe,EACf,0BAA0B,EAC3B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,eAAgB,SAAQ,YAAY,CAAC,qBAAqB,CAAC;;gBAa1D,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,0BAA0B;IAMzE;;;;;OAKG;IACG,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAyCzD,IAAW,eAAe,IAAI,OAAO,GAAG,SAAS,CAEhD;IAED,IAAW,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,EAEtC;IAED,IAAW,QAAQ,IAAI,OAAO,EAAE,CAE/B;IAED,IAAW,eAAe,IAAI,GAAG,GAAG,SAAS,CAE5C;IAED,IAAW,eAAe,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,EAU3D;CACF"}
@@ -0,0 +1,105 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11
+ if (kind === "m") throw new TypeError("Private method is not writable");
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15
+ };
16
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
17
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
19
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
+ };
21
+ var _EIP1193Provider_core, _EIP1193Provider_requestInterceptor, _EIP1193Provider_accounts, _EIP1193Provider_selectedChainId;
22
+ import { EventEmitter } from '@metamask/connect-multichain';
23
+ import { hexToNumber, numberToHex } from '@metamask/utils';
24
+ import { INTERCEPTABLE_METHODS } from './constants';
25
+ import { logger } from './logger';
26
+ /**
27
+ * EIP-1193 Provider wrapper around the Multichain SDK.
28
+ */
29
+ export class EIP1193Provider extends EventEmitter {
30
+ constructor(core, interceptor) {
31
+ super();
32
+ /** The core instance of the Multichain SDK */
33
+ _EIP1193Provider_core.set(this, void 0);
34
+ /** Interceptor function to handle specific methods */
35
+ _EIP1193Provider_requestInterceptor.set(this, void 0);
36
+ /** The currently permitted accounts */
37
+ _EIP1193Provider_accounts.set(this, []);
38
+ /** The currently selected chain ID on the wallet */
39
+ _EIP1193Provider_selectedChainId.set(this, void 0);
40
+ __classPrivateFieldSet(this, _EIP1193Provider_core, core, "f");
41
+ __classPrivateFieldSet(this, _EIP1193Provider_requestInterceptor, interceptor, "f");
42
+ }
43
+ /**
44
+ * Performs a EIP-1193 request.
45
+ *
46
+ * @param request - The request object containing the method and params
47
+ * @returns The result of the request
48
+ */
49
+ request(request) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ var _a, _b, _c;
52
+ logger(`request: ${request.method} - chainId: ${this.selectedChainId}`, request.params);
53
+ /* Some methods require special handling, so we intercept them here
54
+ * and handle them in MetamaskConnectEVM.requestInterceptor method. */
55
+ if (INTERCEPTABLE_METHODS.includes(request.method)) {
56
+ return (_a = __classPrivateFieldGet(this, _EIP1193Provider_requestInterceptor, "f")) === null || _a === void 0 ? void 0 : _a.call(this, request);
57
+ }
58
+ if (!__classPrivateFieldGet(this, _EIP1193Provider_selectedChainId, "f")) {
59
+ // TODO: replace with a better error
60
+ throw new Error('No chain ID selected');
61
+ }
62
+ const chainId = hexToNumber(__classPrivateFieldGet(this, _EIP1193Provider_selectedChainId, "f"));
63
+ const scope = `eip155:${chainId}`;
64
+ // Validate that the chain is configured in supportedNetworks
65
+ // This check is performed here to provide better error messages
66
+ // The RpcClient will also validate, but this gives us a chance to provide
67
+ // a clearer error message before the request is routed
68
+ const coreOptions = __classPrivateFieldGet(this, _EIP1193Provider_core, "f").options; // TODO: options is `protected readonly` property, this needs to be refactored so `any` type assertion is not necessary
69
+ const supportedNetworks = (_c = (_b = coreOptions === null || coreOptions === void 0 ? void 0 : coreOptions.api) === null || _b === void 0 ? void 0 : _b.supportedNetworks) !== null && _c !== void 0 ? _c : {};
70
+ if (!supportedNetworks[scope]) {
71
+ throw new Error(`Chain ${scope} is not configured in supportedNetworks. Requests cannot be made to chains not explicitly configured in supportedNetworks.`);
72
+ }
73
+ return __classPrivateFieldGet(this, _EIP1193Provider_core, "f").invokeMethod({
74
+ scope,
75
+ request: {
76
+ method: request.method,
77
+ params: request.params,
78
+ },
79
+ });
80
+ });
81
+ }
82
+ // Getters and setters
83
+ get selectedAccount() {
84
+ return this.accounts[0];
85
+ }
86
+ set accounts(accounts) {
87
+ __classPrivateFieldSet(this, _EIP1193Provider_accounts, accounts, "f");
88
+ }
89
+ get accounts() {
90
+ return __classPrivateFieldGet(this, _EIP1193Provider_accounts, "f");
91
+ }
92
+ get selectedChainId() {
93
+ return __classPrivateFieldGet(this, _EIP1193Provider_selectedChainId, "f");
94
+ }
95
+ set selectedChainId(chainId) {
96
+ const hexChainId = chainId && typeof chainId === 'number' ? numberToHex(chainId) : chainId;
97
+ // Don't overwrite the selected chain ID with an undefined value
98
+ if (!hexChainId) {
99
+ return;
100
+ }
101
+ __classPrivateFieldSet(this, _EIP1193Provider_selectedChainId, hexChainId, "f");
102
+ }
103
+ }
104
+ _EIP1193Provider_core = new WeakMap(), _EIP1193Provider_requestInterceptor = new WeakMap(), _EIP1193Provider_accounts = new WeakMap(), _EIP1193Provider_selectedChainId = new WeakMap();
105
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASlC;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,YAAmC;IAatE,YAAY,IAAoB,EAAE,WAAuC;QACvE,KAAK,EAAE,CAAC;QAbV,8CAA8C;QACrC,wCAAsB;QAE/B,sDAAsD;QAC7C,sDAAgD;QAEzD,uCAAuC;QACvC,oCAAuB,EAAE,EAAC;QAE1B,oDAAoD;QACpD,mDAAmC;QAIjC,uBAAA,IAAI,yBAAS,IAAI,MAAA,CAAC;QAClB,uBAAA,IAAI,uCAAuB,WAAW,MAAA,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACG,OAAO,CAAC,OAAwB;;;YACpC,MAAM,CACJ,YAAY,OAAO,CAAC,MAAM,eAAe,IAAI,CAAC,eAAe,EAAE,EAC/D,OAAO,CAAC,MAAM,CACf,CAAC;YACF;mFACuE;YACvE,IAAI,qBAAqB,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnD,OAAO,MAAA,uBAAA,IAAI,2CAAoB,+CAAxB,IAAI,EAAuB,OAA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,UAAU,GACd,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAE1E,gEAAgE;QAChE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,uBAAA,IAAI,oCAAoB,UAAiB,MAAA,CAAC;IAC5C,CAAC;CACF"}
@@ -0,0 +1,98 @@
1
+ import type { MultichainCore } from '@metamask/connect-multichain';
2
+ export type Hex = `0x${string}`;
3
+ export type Address = Hex;
4
+ export type CaipAccountId = `${string}:${string}:${string}`;
5
+ export type CaipChainId = `${string}:${string}`;
6
+ export type EIP1193ProviderEvents = {
7
+ connect: [{
8
+ chainId: string;
9
+ }];
10
+ disconnect: [];
11
+ accountsChanged: [Address[]];
12
+ chainChanged: [Hex];
13
+ message: [{
14
+ type: string;
15
+ data: unknown;
16
+ }];
17
+ connectAndSign: [
18
+ {
19
+ accounts: readonly Address[];
20
+ chainId: number;
21
+ signResponse: string;
22
+ }
23
+ ];
24
+ connectWith: [
25
+ {
26
+ accounts: readonly Address[];
27
+ chainId: number;
28
+ connectWithResponse: unknown;
29
+ }
30
+ ];
31
+ };
32
+ export type EventHandlers = {
33
+ connect: (result: {
34
+ chainId: string;
35
+ accounts: Address[];
36
+ }) => void;
37
+ disconnect: () => void;
38
+ accountsChanged: (accounts: Address[]) => void;
39
+ chainChanged: (chainId: Hex) => void;
40
+ connectAndSign: (result: {
41
+ accounts: readonly Address[];
42
+ chainId: number;
43
+ signResponse: string;
44
+ }) => void;
45
+ connectWith: (result: {
46
+ accounts: readonly Address[];
47
+ chainId: number;
48
+ connectWithResponse: unknown;
49
+ }) => void;
50
+ };
51
+ export type MetamaskConnectEVMOptions = {
52
+ core: MultichainCore;
53
+ eventHandlers?: Partial<EventHandlers>;
54
+ notificationQueue?: unknown[];
55
+ supportedNetworks?: Record<CaipChainId, string>;
56
+ };
57
+ export type AddEthereumChainParameter = {
58
+ chainId?: string;
59
+ chainName?: string;
60
+ nativeCurrency?: {
61
+ name?: string;
62
+ symbol?: string;
63
+ decimals?: number;
64
+ };
65
+ rpcUrls?: string[];
66
+ blockExplorerUrls?: string[];
67
+ iconUrls?: string[];
68
+ };
69
+ type ConnectRequest = {
70
+ method: 'wallet_requestPermissions' | 'eth_requestAccounts';
71
+ params: [chainId?: number, account?: string];
72
+ };
73
+ type RevokePermissionsRequest = {
74
+ method: 'wallet_revokePermissions';
75
+ params: unknown[];
76
+ };
77
+ type SwitchEthereumChainRequest = {
78
+ method: 'wallet_switchEthereumChain';
79
+ params: [{
80
+ chainId: string;
81
+ }];
82
+ };
83
+ type AddEthereumChainRequest = {
84
+ method: 'wallet_addEthereumChain';
85
+ params: [AddEthereumChainParameter];
86
+ };
87
+ type AccountsRequest = {
88
+ method: 'eth_accounts' | 'eth_coinbase';
89
+ params: [];
90
+ };
91
+ type GenericProviderRequest = {
92
+ method: Exclude<string, 'wallet_requestPermissions' | 'eth_requestAccounts' | 'eth_accounts' | 'eth_coinbase' | 'wallet_revokePermissions' | 'wallet_switchEthereumChain' | 'wallet_addEthereumChain'>;
93
+ params?: unknown;
94
+ };
95
+ export type ProviderRequest = ConnectRequest | RevokePermissionsRequest | SwitchEthereumChainRequest | AddEthereumChainRequest | AccountsRequest | GenericProviderRequest;
96
+ export type ProviderRequestInterceptor = (req: ProviderRequest) => Promise<unknown>;
97
+ export {};
98
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC;AAC1B,MAAM,MAAM,aAAa,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;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AM,EAAE,yBAAyB,CAAC;IAClC,MAAM,EAAE,CAAC,yBAAyB,CAAC,CAAC;CACrC,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,cAAc,GAAG,cAAc,CAAC;IACxC,MAAM,EAAE,EAAE,CAAC;CACZ,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,OAAO,CACb,MAAM,EACJ,2BAA2B,GAC3B,qBAAqB,GACrB,cAAc,GACd,cAAc,GACd,0BAA0B,GAC1B,4BAA4B,GAC5B,yBAAyB,CAC5B,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAGF,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,wBAAwB,GACxB,0BAA0B,GAC1B,uBAAuB,GACvB,eAAe,GACf,sBAAsB,CAAC;AAE3B,MAAM,MAAM,0BAA0B,GAAG,CACvC,GAAG,EAAE,eAAe,KACjB,OAAO,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { SessionData } from '@metamask/connect-multichain';
2
+ import type { Address, Hex } from '../types';
3
+ /**
4
+ * Get the Ethereum accounts from the session data
5
+ *
6
+ * @param sessionScopes - The session scopes
7
+ * @returns The Ethereum accounts
8
+ */
9
+ export declare const getEthAccounts: (sessionScopes: SessionData["sessionScopes"] | undefined) => Address[];
10
+ /**
11
+ * Get the permitted Ethereum chain IDs from the session scopes.
12
+ * Wrapper around getPermittedEthChainIds from @metamask/chain-agnostic-permission
13
+ *
14
+ * @param sessionScopes - The session scopes
15
+ * @returns The permitted Ethereum chain IDs
16
+ */
17
+ export declare const getPermittedEthChainIds: (sessionScopes: SessionData["sessionScopes"] | undefined) => Hex[];
18
+ //# sourceMappingURL=caip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.d.ts","sourceRoot":"","sources":["../../../src/utils/caip.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,eAAe,WAAW,CAAC,eAAe,CAAC,GAAG,SAAS,KACtD,OAAO,EAST,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GAClC,eAAe,WAAW,CAAC,eAAe,CAAC,GAAG,SAAS,KACtD,GAAG,EASL,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { getPermittedEthChainIds as _getPermittedEthChainIds, getEthAccounts as _getEthAccounts, } from '@metamask/chain-agnostic-permission';
2
+ /**
3
+ * Get the Ethereum accounts from the session data
4
+ *
5
+ * @param sessionScopes - The session scopes
6
+ * @returns The Ethereum accounts
7
+ */
8
+ export const getEthAccounts = (sessionScopes) => {
9
+ if (!sessionScopes) {
10
+ return [];
11
+ }
12
+ return _getEthAccounts({
13
+ requiredScopes: sessionScopes,
14
+ optionalScopes: sessionScopes,
15
+ });
16
+ };
17
+ /**
18
+ * Get the permitted Ethereum chain IDs from the session scopes.
19
+ * Wrapper around getPermittedEthChainIds from @metamask/chain-agnostic-permission
20
+ *
21
+ * @param sessionScopes - The session scopes
22
+ * @returns The permitted Ethereum chain IDs
23
+ */
24
+ export const getPermittedEthChainIds = (sessionScopes) => {
25
+ if (!sessionScopes) {
26
+ return [];
27
+ }
28
+ return _getPermittedEthChainIds({
29
+ requiredScopes: sessionScopes,
30
+ optionalScopes: sessionScopes,
31
+ });
32
+ };
33
+ //# sourceMappingURL=caip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"caip.js","sourceRoot":"","sources":["../../../src/utils/caip.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,IAAI,wBAAwB,EACnD,cAAc,IAAI,eAAe,GAClC,MAAM,qCAAqC,CAAC;AAK7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,aAAuD,EAC5C,EAAE;IACb,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,eAAe,CAAC;QACrB,cAAc,EAAE,aAAqC;QACrD,cAAc,EAAE,aAAqC;KACtD,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,aAAuD,EAChD,EAAE;IACT,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,wBAAwB,CAAC;QAC9B,cAAc,EAAE,aAAqC;QACrD,cAAc,EAAE,aAAqC;KACtD,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { ProviderRequest } from '../types';
2
+ /**
3
+ * Type guard for connect-like requests:
4
+ * - wallet_requestPermissions
5
+ * - eth_requestAccounts
6
+ *
7
+ * @param req - The request object to check
8
+ * @returns True if the request is a connect-like request, false otherwise
9
+ */
10
+ export declare function isConnectRequest(req: ProviderRequest): req is Extract<ProviderRequest, {
11
+ method: 'wallet_requestPermissions' | 'eth_requestAccounts';
12
+ }>;
13
+ /**
14
+ * Type guard for wallet_switchEthereumChain request.
15
+ *
16
+ * @param req - The request object to check
17
+ * @returns True if the request is a wallet_switchEthereumChain request, false otherwise
18
+ */
19
+ export declare function isSwitchChainRequest(req: ProviderRequest): req is Extract<ProviderRequest, {
20
+ method: 'wallet_switchEthereumChain';
21
+ }>;
22
+ /**
23
+ * Type guard for wallet_addEthereumChain request.
24
+ *
25
+ * @param req - The request object to check
26
+ * @returns True if the request is a wallet_addEthereumChain request, false otherwise
27
+ */
28
+ export declare function isAddChainRequest(req: ProviderRequest): req is Extract<ProviderRequest, {
29
+ method: 'wallet_addEthereumChain';
30
+ }>;
31
+ /**
32
+ * Type guard for generic accounts request:
33
+ * - eth_accounts
34
+ * - eth_coinbase
35
+ *
36
+ * @param req - The request object to check
37
+ * @returns True if the request is a generic accounts request, false otherwise
38
+ */
39
+ export declare function isAccountsRequest(req: ProviderRequest): req is Extract<ProviderRequest, {
40
+ method: 'eth_accounts' | 'eth_coinbase';
41
+ }>;
42
+ /**
43
+ * Validates that all values in a Record are valid URLs.
44
+ *
45
+ * @param record - The record to validate (e.g., supportedNetworks)
46
+ * @param recordName - The name of the record for error messages
47
+ * @throws Error if any values are invalid URLs
48
+ */
49
+ export declare function validSupportedChainsUrls(record: Record<string, string>, recordName: string): void;
50
+ //# sourceMappingURL=type-guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../../src/utils/type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,OAAO,CACpE,eAAe,EACf;IACE,MAAM,EAAE,2BAA2B,GAAG,qBAAqB,CAAC;CAC7D,CACF,CAKA;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,eAAe,GACnB,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE;IAAE,MAAM,EAAE,4BAA4B,CAAA;CAAE,CAAC,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,GACnB,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE;IAAE,MAAM,EAAE,yBAAyB,CAAA;CAAE,CAAC,CAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,eAAe,GACnB,GAAG,IAAI,OAAO,CACf,eAAe,EACf;IAAE,MAAM,EAAE,cAAc,GAAG,cAAc,CAAA;CAAE,CAC5C,CAEA;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,UAAU,EAAE,MAAM,GACjB,IAAI,CAgBN"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Type guard for connect-like requests:
3
+ * - wallet_requestPermissions
4
+ * - eth_requestAccounts
5
+ *
6
+ * @param req - The request object to check
7
+ * @returns True if the request is a connect-like request, false otherwise
8
+ */
9
+ export function isConnectRequest(req) {
10
+ return (req.method === 'wallet_requestPermissions' ||
11
+ req.method === 'eth_requestAccounts');
12
+ }
13
+ /**
14
+ * Type guard for wallet_switchEthereumChain request.
15
+ *
16
+ * @param req - The request object to check
17
+ * @returns True if the request is a wallet_switchEthereumChain request, false otherwise
18
+ */
19
+ export function isSwitchChainRequest(req) {
20
+ return req.method === 'wallet_switchEthereumChain';
21
+ }
22
+ /**
23
+ * Type guard for wallet_addEthereumChain request.
24
+ *
25
+ * @param req - The request object to check
26
+ * @returns True if the request is a wallet_addEthereumChain request, false otherwise
27
+ */
28
+ export function isAddChainRequest(req) {
29
+ return req.method === 'wallet_addEthereumChain';
30
+ }
31
+ /**
32
+ * Type guard for generic accounts request:
33
+ * - eth_accounts
34
+ * - eth_coinbase
35
+ *
36
+ * @param req - The request object to check
37
+ * @returns True if the request is a generic accounts request, false otherwise
38
+ */
39
+ export function isAccountsRequest(req) {
40
+ return req.method === 'eth_accounts' || req.method === 'eth_coinbase';
41
+ }
42
+ /**
43
+ * Validates that all values in a Record are valid URLs.
44
+ *
45
+ * @param record - The record to validate (e.g., supportedNetworks)
46
+ * @param recordName - The name of the record for error messages
47
+ * @throws Error if any values are invalid URLs
48
+ */
49
+ export function validSupportedChainsUrls(record, recordName) {
50
+ const invalidUrls = [];
51
+ for (const [key, url] of Object.entries(record)) {
52
+ try {
53
+ // eslint-disable-next-line no-new
54
+ new URL(url);
55
+ }
56
+ catch (_a) {
57
+ invalidUrls.push(`${key}: ${url}`);
58
+ }
59
+ }
60
+ if (invalidUrls.length > 0) {
61
+ throw new Error(`${recordName} contains invalid URLs:\n${invalidUrls.join('\n')}`);
62
+ }
63
+ }
64
+ //# sourceMappingURL=type-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../../../src/utils/type-guards.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAoB;IAMnD,OAAO,CACL,GAAG,CAAC,MAAM,KAAK,2BAA2B;QAC1C,GAAG,CAAC,MAAM,KAAK,qBAAqB,CACrC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAoB;IAEpB,OAAO,GAAG,CAAC,MAAM,KAAK,4BAA4B,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAoB;IAEpB,OAAO,GAAG,CAAC,MAAM,KAAK,yBAAyB,CAAC;AAClD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAoB;IAKpB,OAAO,GAAG,CAAC,MAAM,KAAK,cAAc,IAAI,GAAG,CAAC,MAAM,KAAK,cAAc,CAAC;AACxE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAA8B,EAC9B,UAAkB;IAElB,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,IAAI,CAAC;YACH,kCAAkC;YAClC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QAAC,WAAM,CAAC;YACP,WAAW,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CACb,GAAG,UAAU,4BAA4B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClE,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -117,6 +117,15 @@ declare class EIP1193Provider extends EventEmitter<EIP1193ProviderEvents> {
117
117
  set selectedChainId(chainId: Hex | number | undefined);
118
118
  }
119
119
 
120
+ /** The options for the connect method */
121
+ type ConnectOptions = {
122
+ /** The account to connect to */
123
+ account?: string | undefined;
124
+ /** Whether to force a request regardless of an existing session */
125
+ forceRequest?: boolean;
126
+ /** All available chain IDs in the dapp */
127
+ chainIds: number[];
128
+ };
120
129
  /**
121
130
  * The MetamaskConnectEVM class provides an EIP-1193 compatible interface for connecting
122
131
  * to MetaMask and interacting with Ethereum Virtual Machine (EVM) networks.
@@ -158,43 +167,44 @@ declare class MetamaskConnectEVM {
158
167
  * Connects to the wallet with the specified chain ID and optional account.
159
168
  *
160
169
  * @param options - The connection options
161
- * @param options.chainId - The chain ID to connect to (defaults to 1 for mainnet)
162
170
  * @param options.account - Optional specific account to connect to
163
171
  * @param options.forceRequest - Wwhether to force a request regardless of an existing session
172
+ * @param options.chainIds - Array of chain IDs to connect to
164
173
  * @returns A promise that resolves with the connected accounts and chain ID
165
174
  */
166
- connect({ chainId, account, forceRequest, }?: {
167
- chainId: number;
168
- account?: string | undefined;
169
- forceRequest?: boolean;
170
- }): Promise<{
175
+ connect({ account, forceRequest, chainIds }?: ConnectOptions): Promise<{
171
176
  accounts: Address[];
172
177
  chainId: number;
173
178
  }>;
174
179
  /**
175
180
  * Connects to the wallet and signs a message using personal_sign.
176
181
  *
177
- * @param message - The message to sign
182
+ * @param options - The connection options
183
+ * @param options.message - The message to sign after connecting
184
+ * @param options.chainIds - Optional chain IDs to connect to (defaults to ethereum mainnet if not provided)
178
185
  * @returns A promise that resolves with the signature
179
186
  * @throws Error if the selected account is not available after timeout
180
187
  */
181
- connectAndSign(message: string): Promise<string>;
188
+ connectAndSign({ message, chainIds, }: {
189
+ message: string;
190
+ chainIds?: number[];
191
+ }): Promise<string>;
182
192
  /**
183
193
  * Connects to the wallet and invokes a method with specified parameters.
184
194
  *
185
195
  * @param options - The options for connecting and invoking the method
186
196
  * @param options.method - The method name to invoke
187
197
  * @param options.params - The parameters to pass to the method, or a function that receives the account and returns params
188
- * @param options.chainId - Optional chain ID to connect to (defaults to mainnet)
198
+ * @param options.chainIds - Optional chain IDs to connect to (defaults to ethereum mainnet if not provided)
189
199
  * @param options.account - Optional specific account to connect to
190
200
  * @param options.forceRequest - Whether to force a request regardless of an existing session
191
201
  * @returns A promise that resolves with the result of the method invocation
192
202
  * @throws Error if the selected account is not available after timeout (for methods that require an account)
193
203
  */
194
- connectWith({ method, params, chainId, account, forceRequest, }: {
204
+ connectWith({ method, params, chainIds, account, forceRequest, }: {
195
205
  method: string;
196
206
  params: unknown[] | ((account: Address) => unknown[]);
197
- chainId?: number;
207
+ chainIds?: number[];
198
208
  account?: string | undefined;
199
209
  forceRequest?: boolean;
200
210
  }): Promise<unknown>;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@metamask/connect-evm",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "EVM Layer for MetaMask Connect",
5
5
  "keywords": [
6
6
  "MetaMask",
7
7
  "Ethereum"
8
8
  ],
9
- "homepage": "https://github.com/MetaMask/metamask-connect-monorepo/tree/main/packages/connect-evm#readme",
9
+ "homepage": "https://github.com/MetaMask/connect-monorepo/tree/main/packages/connect-evm#readme",
10
10
  "bugs": {
11
11
  "url": ""
12
12
  },
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "https://github.com/MetaMask/metamask-connect-monorepo.git"
15
+ "url": "https://github.com/MetaMask/connect-monorepo.git"
16
16
  },
17
17
  "license": "MIT",
18
18
  "sideEffects": false,
@@ -56,7 +56,7 @@
56
56
  "dependencies": {
57
57
  "@metamask/analytics": "^0.2.0",
58
58
  "@metamask/chain-agnostic-permission": "^1.2.2",
59
- "@metamask/connect-multichain": "^0.3.2",
59
+ "@metamask/connect-multichain": "^0.4.0",
60
60
  "@metamask/utils": "^11.8.1"
61
61
  },
62
62
  "devDependencies": {
@@ -68,11 +68,11 @@
68
68
  "tsup": "^8.4.0",
69
69
  "typedoc": "^0.28.14",
70
70
  "typedoc-plugin-missing-exports": "^4.1.2",
71
- "typescript": "~5.9.2",
71
+ "typescript": "^5.9.3",
72
72
  "vitest": "^3.1.2"
73
73
  },
74
74
  "engines": {
75
- "node": "^18.18 || >=20"
75
+ "node": ">=20.19.0"
76
76
  },
77
77
  "publishConfig": {
78
78
  "access": "public",