File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
packages/@magic-ext/evm/src Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
import { Extension } from '@magic-sdk/provider' ;
2
- import { EVMNetworkConfig , EVMPayloadMethod , SwitchEVMChainResult } from './types' ;
2
+ import { EVMNetworkConfig , EVMPayloadMethod } from './types' ;
3
3
4
4
export class EVMExtension extends Extension . Internal < 'evm' , any > {
5
5
name = 'evm' as const ;
@@ -14,8 +14,15 @@ export class EVMExtension extends Extension.Internal<'evm', any> {
14
14
}
15
15
16
16
public switchEVMChain = ( chainId : number ) => {
17
- return this . request < string | SwitchEVMChainResult > (
18
- this . utils . createJsonRpcRequestPayload ( EVMPayloadMethod . SwitchEVMChain , [ chainId ] ) ,
19
- ) ;
17
+ return this . request < {
18
+ network :
19
+ | string
20
+ | {
21
+ rpcUrl : string ;
22
+ chainId ?: number ;
23
+ chainType ?: string ;
24
+ }
25
+ | undefined ;
26
+ } > ( this . utils . createJsonRpcRequestPayload ( EVMPayloadMethod . SwitchEVMChain , [ { chainId } ] ) ) ;
20
27
} ;
21
28
}
Original file line number Diff line number Diff line change @@ -7,9 +7,3 @@ export enum EVMPayloadMethod {
7
7
export interface EVMNetworkConfig extends CustomNodeConfiguration {
8
8
default ?: boolean ;
9
9
}
10
-
11
- export interface SwitchEVMChainResult {
12
- rpcUrl : string ;
13
- chainId ?: number ;
14
- chainType ?: string ;
15
- }
You can’t perform that action at this time.
0 commit comments