Skip to content

Commit 82187ba

Browse files
committed
updates evm method name
1 parent 58d15a9 commit 82187ba

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const provider = new ethers.BrowserProvider(magic.rpcProvider);
9797
const network = await provider.getNetwork();
9898
console.log(network.chainId); // => 137
9999

100-
magic.evm.switchEVMChain(10);
100+
magic.evm.switchChain(10);
101101

102102
const network = await provider.getNetwork();
103103
console.log(network.chainId); // => 10

packages/@magic-ext/evm/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class EVMExtension extends Extension.Internal<'evm', any> {
1313
};
1414
}
1515

16-
public switchEVMChain = (chainId: number) => {
16+
public switchChain = (chainId: number) => {
1717
return this.request<{
1818
network:
1919
| string
@@ -23,6 +23,6 @@ export class EVMExtension extends Extension.Internal<'evm', any> {
2323
chainType?: string;
2424
}
2525
| undefined;
26-
}>(this.utils.createJsonRpcRequestPayload(EVMPayloadMethod.SwitchEVMChain, [{ chainId }]));
26+
}>(this.utils.createJsonRpcRequestPayload(EVMPayloadMethod.switchChain, [{ chainId }]));
2727
};
2828
}

packages/@magic-ext/evm/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CustomNodeConfiguration } from '@magic-sdk/types';
22

33
export enum EVMPayloadMethod {
4-
SwitchEVMChain = 'evm_switchChain',
4+
switchChain = 'evm_switchChain',
55
}
66

77
export interface EVMNetworkConfig extends CustomNodeConfiguration {

0 commit comments

Comments
 (0)