Skip to content

Commit d7758a6

Browse files
committed
fix: repair chain fix
1 parent 9f69229 commit d7758a6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/account/default.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StarknetChainId, ZERO } from '../constants';
1+
import { ZERO } from '../constants';
22
import { ProviderInterface, ProviderOptions } from '../provider';
33
import { Provider } from '../provider/default';
44
import { Signer, SignerInterface } from '../signer';
@@ -32,10 +32,6 @@ export class Account extends Provider implements AccountInterface {
3232
'getPubKey' in keyPairOrSigner ? keyPairOrSigner : new Signer(keyPairOrSigner as KeyPair);
3333
}
3434

35-
public async getChainId(): Promise<StarknetChainId> {
36-
return this.getChainId();
37-
}
38-
3935
public async getNonce(): Promise<string> {
4036
const { result } = await this.callContract({
4137
contractAddress: this.address,

src/provider/default.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export class Provider implements ProviderInterface {
4646
return this.provider.chainId;
4747
}
4848

49+
public async getChainId(): Promise<StarknetChainId> {
50+
return this.provider.getChainId();
51+
}
52+
4953
public async getBlock(blockIdentifier: BlockIdentifier = 'pending'): Promise<GetBlockResponse> {
5054
return this.provider.getBlock(blockIdentifier);
5155
}

src/provider/interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { BlockIdentifier } from './utils';
2222
export abstract class ProviderInterface {
2323
public abstract chainId: StarknetChainId;
2424

25+
public abstract getChainId(): Promise<StarknetChainId>;
26+
2527
/**
2628
* Calls a function on the StarkNet contract.
2729
*

0 commit comments

Comments
 (0)